Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix git describe version injected to the frontend #10320

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ services:
additional_contexts:
test_data: tests/data
static_assets: assets
args:
OSRD_GIT_DESCRIBE: development
environment:
# Actual values in ./docker/osrdyne.yml (please maintain consistency)
# Provided here only for reuse in compose layers and doc
Expand All @@ -90,7 +92,7 @@ services:
test_data: tests/data
dockerfile: docker/Dockerfile.${OSRD_FRONT_MODE-devel}
args:
OSRD_GIT_DESCRIBE: ${OSRD_GIT_DESCRIBE}
OSRD_GIT_DESCRIBE: development
environment:
FRONT_PORT: 3000 # only useful with the prod config
OSRD_EDITOAST_URL: /api
Expand Down Expand Up @@ -120,6 +122,7 @@ services:
static_assets: assets
args:
CARGO_PROFILE: dev
OSRD_GIT_DESCRIBE: development
restart: unless-stopped
ports: [ "8090:80" ]
environment:
Expand Down
1 change: 0 additions & 1 deletion front/.env.example

This file was deleted.

4 changes: 4 additions & 0 deletions front/docker/Dockerfile.devel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ COPY --from=exec_as_builder /exec-as /

WORKDIR /app

# Fill build time values
ARG OSRD_GIT_DESCRIBE
ENV VITE_OSRD_GIT_DESCRIBE=${OSRD_GIT_DESCRIBE}

# Start the app
COPY docker/dev-entrypoint.sh /
ENTRYPOINT ["/dev-entrypoint.sh"]
Expand Down
16 changes: 7 additions & 9 deletions front/docker/Dockerfile.nginx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ FROM node:20-bookworm AS build

WORKDIR /app


# Build dependencies
COPY package.json package-lock.json /app/
RUN npm install --frozen-lockfile

# Fill build time values
ARG OSRD_GIT_DESCRIBE
ENV VITE_OSRD_GIT_DESCRIBE=${OSRD_GIT_DESCRIBE}

# Generate the licenses file and build
COPY . /app
RUN npm run generate-licenses && npm run build
Expand All @@ -23,18 +28,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
flomonster marked this conversation as resolved.
Show resolved Hide resolved

RUN 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 ["sh", "-c", "exec nginx -g 'daemon off;'"]
Loading
Loading