-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
#1855) * build: use same dockerfiles for all frontends debug/prod * build: update build and nginx config for mapper/manager frontends * ci: update frontend build stage context * build: upgrade pdm version in backend dockerfile * build: add temp 'packaging' dep and relock
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,8 +58,8 @@ jobs: | |
uses: hotosm/gh-workflows/.github/workflows/[email protected] | ||
needs: [frontend-unit-test, frontend-e2e-test] | ||
with: | ||
context: src/frontend | ||
dockerfile: prod.dockerfile | ||
context: src | ||
dockerfile: Dockerfile.ui.prod | ||
build_target: prod | ||
image_name: ghcr.io/${{ github.repository }}/frontend | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ RUN set -ex \ | |
"openssl" \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
WORKDIR /app | ||
COPY ./package.json ./pnpm-lock.yaml ./ | ||
COPY --from=code ./package.json ./pnpm-lock.yaml ./ | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable && corepack use [email protected] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
FROM docker.io/node:20 as builder | ||
|
||
FROM docker.io/node:20 as base | ||
Check warning on line 1 in src/Dockerfile.ui.prod GitHub Actions / frontend-build / build-imageThe 'as' keyword should match the case of the 'from' keyword
|
||
ARG NODE_ENV | ||
ARG VITE_API_URL | ||
ENV VITE_API_URL="${VITE_API_URL}" | ||
|
||
WORKDIR /app | ||
COPY ./package.json ./pnpm-lock.yaml ./ | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
ENV VITE_API_URL=${VITE_API_URL} \ | ||
Check warning on line 4 in src/Dockerfile.ui.prod GitHub Actions / frontend-build / build-imageVariables should be defined before their use
|
||
NODE_ENV=${NODE_ENV} \ | ||
PNPM_HOME="/pnpm" \ | ||
PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable && corepack use [email protected] | ||
RUN pnpm install | ||
WORKDIR /app | ||
|
||
ARG NODE_ENV | ||
ENV NODE_ENV ${NODE_ENV} | ||
COPY . . | ||
|
||
FROM base as manager-frontend | ||
Check warning on line 12 in src/Dockerfile.ui.prod GitHub Actions / frontend-build / build-imageThe 'as' keyword should match the case of the 'from' keyword
|
||
COPY frontend/package.json frontend/pnpm-lock.yaml ./ | ||
RUN pnpm install | ||
COPY frontend/ . | ||
RUN pnpm run build --mode ${NODE_ENV} | ||
|
||
|
||
FROM base as mapper-frontend | ||
Check warning on line 19 in src/Dockerfile.ui.prod GitHub Actions / frontend-build / build-imageThe 'as' keyword should match the case of the 'from' keyword
|
||
COPY mapper/package.json mapper/pnpm-lock.yaml ./ | ||
RUN pnpm install | ||
COPY mapper/ . | ||
RUN pnpm run build --mode ${NODE_ENV} | ||
|
||
|
||
FROM docker.io/rclone/rclone:1 as prod | ||
Check warning on line 26 in src/Dockerfile.ui.prod GitHub Actions / frontend-build / build-imageThe 'as' keyword should match the case of the 'from' keyword
|
||
ARG APP_VERSION | ||
|
@@ -31,4 +37,5 @@ COPY container-entrypoint.sh / | |
RUN chmod +x /container-entrypoint.sh | ||
ENTRYPOINT ["/container-entrypoint.sh"] | ||
WORKDIR /app | ||
COPY --from=builder /app/dist . | ||
COPY --from=manager-frontend /app/dist ./manager-frontend | ||
COPY --from=mapper-frontend /app/build ./mapper-frontend |