Skip to content

Commit

Permalink
docker: add git describe var to gateway image with front
Browse files Browse the repository at this point in the history
  • Loading branch information
flomonster committed Jan 10, 2025
1 parent 62932d4 commit 8903806
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions front/docker/Dockerfile.nginx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ RUN npm install --frozen-lockfile
COPY . /app
RUN npm run generate-licenses && npm run build

# Add config.json static file
ARG OSRD_GIT_DESCRIBE
ENV OSRD_GIT_DESCRIBE=${OSRD_GIT_DESCRIBE}
RUN 'echo "{\"OSRD_GIT_DESCRIBE\": \"${OSRD_GIT_DESCRIBE}\"}" > /app/config.json'


### TESTS STAGE

FROM build AS tests
Expand All @@ -23,18 +29,11 @@ COPY --from=test_data . /tests/data

FROM nginx:alpine

RUN apk add npm && \
npm install -g @import-meta-env/cli && \
rm /etc/nginx/conf.d/default.conf

COPY docker/nginx.conf /etc/nginx/conf.d
COPY docker/nginx-entrypoint.sh /entrypoint.sh

COPY --from=build /app/build /srv
COPY --from=build /app/.env.example /

ARG OSRD_GIT_DESCRIBE
ENV OSRD_GIT_DESCRIBE=${OSRD_GIT_DESCRIBE}

ENTRYPOINT ["/entrypoint.sh"]
CMD ["sh", "-c", "npx import-meta-env -x /.env.example -p /srv/index.html && exec nginx -g 'daemon off;'"]
CMD ["nginx", "-g", "daemon off"]

0 comments on commit 8903806

Please sign in to comment.