Skip to content
Snippets Groups Projects

include TRANSLATIONS_DIR as environment variable in the Docker image

Merged Karel van Klink requested to merge feature/update-dockerfile into develop
1 file
+ 10
6
Compare changes
  • Side-by-side
  • Inline
+ 10
6
FROM python:3.11-alpine
WORKDIR /app
ARG ARTIFACT_VERSION
RUN apk add gcc libc-dev libffi-dev
RUN apk add --no-cache gcc libc-dev libffi-dev && \
addgroup -S appgroup && adduser -S appuser -G appgroup -h /app
USER appuser
RUN pip install \
--pre \
--extra-index-url https://artifactory.software.geant.org/artifactory/api/pypi/geant-swd-pypi/simple \
--target /app \
geant-service-orchestrator==${ARTIFACT_VERSION}
WORKDIR /app
# Create the directory for the configuration and copy the example config into it
# NOTE: a real config must be mounted at /etc/gso/config.json when running the container
RUN mkdir -p /etc/gso
COPY gso/oss-params-example.json /etc/gso/config.json
RUN mkdir -p /etc/gso && \
chown -R appuser:appgroup /etc/gso
COPY --chown=appuser:appgroup gso/oss-params-example.json /etc/gso/config.json
# Expose port 8080 for the FastAPI application
EXPOSE 8080
# The app reads the configuration from this location.
# No need to set environment variables in your docker-compose.
ENV OSS_PARAMS_FILENAME=/etc/gso/config.json
@@ -27,4+30,4 @@
# Run database migrations
RUN mv gso/migrations gso/migrations_temp
RUN PYTHONPATH=. python gso/main.py db init
RUN rm -rf gso/migrations && mv gso/migrations_temp gso/migrations
RUN rm -rf gso/migrations && \
mv gso/migrations_temp gso/migrations
RUN PYTHONPATH=. python gso/main.py db upgrade heads
# Start the FastAPI application
Loading