Skip to content

Commit

Permalink
dev: resilient gateway build for dev front
Browse files Browse the repository at this point in the history
Signed-off-by: Élyse Viard <[email protected]>
  • Loading branch information
ElysaSrc committed Feb 8, 2025
1 parent b443b6a commit 7fd5a60
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docker/docker-compose.front.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ services:
image: ghcr.io/openrailassociation/osrd-edge/osrd-gateway:${TAG-dev}-${GATEWAY_FLAVOR-standalone}
volumes:
- "./docker/gateway.dev.front.toml:/srv/gateway.toml"
build:
args:
SKIP_BAD_FRONT: "1"

front:
image: ghcr.io/openrailassociation/osrd-edge/osrd-front:${TAG-dev}-dev
Expand Down
3 changes: 3 additions & 0 deletions docker/docker-compose.host-front.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ services:
image: ghcr.io/openrailassociation/osrd-edge/osrd-gateway:${TAG-dev}-${GATEWAY_FLAVOR-standalone}
volumes:
- "./docker/gateway.dev.host-front.toml:/srv/gateway.toml"
build:
args:
SKIP_BAD_FRONT: "1"

front:
image: ghcr.io/openrailassociation/osrd-edge/osrd-front:${TAG-dev}-dev
Expand Down
7 changes: 6 additions & 1 deletion gateway/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ CMD ["/usr/local/bin/osrd_gateway"]
FROM node:23-bookworm AS front_build
WORKDIR /app

# Add build argument for skipping failed front
ARG SKIP_BAD_FRONT=0

# Build dependencies
COPY --from=front_src package.json package-lock.json /app/
RUN npm install --frozen-lockfile
Expand All @@ -74,7 +77,9 @@ ENV VITE_OSRD_GIT_DESCRIBE=${OSRD_GIT_DESCRIBE}
# Generate the licenses file and build
COPY --from=front_src . /app
ENV NODE_OPTIONS="--max_old_space_size=4096"
RUN npm run generate-licenses && npm run build
RUN (npm run generate-licenses && npm run build) || \
(test "$SKIP_BAD_FRONT" = "1" && mkdir -p build && \
echo '<html><body><h1>Front build failed : check logs.</h1></body></html>' > build/index.html)

#######################
# Running env : front #
Expand Down

0 comments on commit 7fd5a60

Please sign in to comment.