-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4aedf17
commit 947c5dd
Showing
5 changed files
with
30 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
# This dockerfile only builds the javascript part of the project, so tsc and angular compilation | ||
|
||
FROM node:20 AS BUILDER_STAGE1 | ||
FROM node:20 AS builder_stage1 | ||
|
||
RUN npm install -g pnpm | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
ADD . /picsur | ||
WORKDIR /picsur | ||
|
||
RUN yarn workspaces focus -A | ||
RUN pnpm install --frozen-lockfile | ||
|
||
RUN yarn workspace picsur-shared build | ||
RUN yarn workspace picsur-frontend build | ||
RUN yarn workspace picsur-backend build | ||
RUN pnpm --filter picsur-shared build | ||
RUN pnpm --filter picsur-frontend build | ||
RUN pnpm --filter picsur-backend build | ||
|
||
RUN mkdir -p /trimmed | ||
|
||
RUN cp -r --parents ./{package.json,yarn.lock,.yarnrc.yml,branding} /trimmed | ||
RUN cp -r --parents ./{package.json,pnpm-lock.yaml,pnpm-workspace.yaml,branding} /trimmed | ||
RUN cp -r --parents ./{frontend,backend,shared}/{dist,package.json} /trimmed | ||
|
||
FROM scratch | ||
|
||
WORKDIR /picsur | ||
ADD .yarn .yarn | ||
COPY --from=BUILDER_STAGE1 /trimmed ./ | ||
|
||
COPY --from=builder_stage1 /trimmed ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
# This dockerfile than builds the production dependencies and the final image | ||
|
||
# Always fetch amd64 image | ||
FROM ghcr.io/caramelfur/picsur-alpha-stage1:latest AS BUILDER_STAGE1 | ||
FROM ghcr.io/caramelfur/picsur-alpha-stage1:latest AS builder_stage1 | ||
|
||
FROM node:20-alpine AS BUILDER_STAGE2 | ||
FROM node:20-alpine AS builder_stage2 | ||
|
||
RUN npm install -g pnpm | ||
|
||
RUN apk add python3 build-base | ||
|
||
WORKDIR /picsur | ||
COPY --from=BUILDER_STAGE1 /picsur ./ | ||
COPY --from=builder_stage1 /picsur ./ | ||
|
||
RUN yarn workspaces focus -A --production | ||
RUN pnpm install --frozen-lockfile --prod | ||
|
||
FROM node:20-alpine | ||
|
||
RUN npm install -g pnpm | ||
|
||
ENV PICSUR_PRODUCTION=true | ||
|
||
WORKDIR /picsur | ||
COPY --from=BUILDER_STAGE2 /picsur ./ | ||
COPY --from=builder_stage2 /picsur ./ | ||
|
||
CMD ["pnpm", "--filter", "picsur-backend", "start:prod"] | ||
|
||
CMD yarn workspace picsur-backend start:prod |