Skip to content

Commit 7fd5a60

Browse files
committed
dev: resilient gateway build for dev front
Signed-off-by: Élyse Viard <elysasrc@tuta.com>
1 parent b443b6a commit 7fd5a60

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

docker/docker-compose.front.yml

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ services:
33
image: ghcr.io/openrailassociation/osrd-edge/osrd-gateway:${TAG-dev}-${GATEWAY_FLAVOR-standalone}
44
volumes:
55
- "./docker/gateway.dev.front.toml:/srv/gateway.toml"
6+
build:
7+
args:
8+
SKIP_BAD_FRONT: "1"
69

710
front:
811
image: ghcr.io/openrailassociation/osrd-edge/osrd-front:${TAG-dev}-dev

docker/docker-compose.host-front.yml

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ services:
33
image: ghcr.io/openrailassociation/osrd-edge/osrd-gateway:${TAG-dev}-${GATEWAY_FLAVOR-standalone}
44
volumes:
55
- "./docker/gateway.dev.host-front.toml:/srv/gateway.toml"
6+
build:
7+
args:
8+
SKIP_BAD_FRONT: "1"
69

710
front:
811
image: ghcr.io/openrailassociation/osrd-edge/osrd-front:${TAG-dev}-dev

gateway/Dockerfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ CMD ["/usr/local/bin/osrd_gateway"]
6363
FROM node:23-bookworm AS front_build
6464
WORKDIR /app
6565

66+
# Add build argument for skipping failed front
67+
ARG SKIP_BAD_FRONT=0
68+
6669
# Build dependencies
6770
COPY --from=front_src package.json package-lock.json /app/
6871
RUN npm install --frozen-lockfile
@@ -74,7 +77,9 @@ ENV VITE_OSRD_GIT_DESCRIBE=${OSRD_GIT_DESCRIBE}
7477
# Generate the licenses file and build
7578
COPY --from=front_src . /app
7679
ENV NODE_OPTIONS="--max_old_space_size=4096"
77-
RUN npm run generate-licenses && npm run build
80+
RUN (npm run generate-licenses && npm run build) || \
81+
(test "$SKIP_BAD_FRONT" = "1" && mkdir -p build && \
82+
echo '<html><body><h1>Front build failed : check logs.</h1></body></html>' > build/index.html)
7883

7984
#######################
8085
# Running env : front #

0 commit comments

Comments
 (0)