-
Notifications
You must be signed in to change notification settings - Fork 3
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
281da20
commit 48100cb
Showing
26 changed files
with
102 additions
and
276 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
FROM diamonds2_base:latest as base | ||
FROM diamonds2_base:latest AS base | ||
WORKDIR /app/packages/backend | ||
RUN apk update && apk add --no-cache openssl libc6-compat | ||
RUN apt-get update -y && apt-get install -y openssl | ||
COPY --chown=1000:1000 packages/backend . | ||
|
||
FROM base AS develop | ||
ENV PORT=3000 | ||
EXPOSE $PORT | ||
CMD ["yarn", "start:dev"] | ||
CMD ["deno", "run", "start:dev"] | ||
|
||
FROM develop AS build | ||
RUN npm run build | ||
RUN SKIP_POSTINSTALL=true yarn workspaces focus --all --production | ||
|
||
FROM node:20-alpine AS prod | ||
FROM base AS prod | ||
ENV PORT=3000 | ||
WORKDIR /app | ||
COPY --chown=1000:1000 --from=build /app/packages/backend/dist . | ||
COPY --chown=1000:1000 --from=build /app/node_modules ./node_modules | ||
COPY --chown=1000:1000 --from=build /app/packages ./packages | ||
EXPOSE $PORT | ||
CMD ["node", "index.js"] | ||
CMD ["run", "start:prod"] |
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,30 +1,24 @@ | ||
FROM node:20-alpine as base | ||
FROM denoland/deno:2.0.6 AS base | ||
WORKDIR /app | ||
RUN chown 1000:1000 . | ||
|
||
# Set yarn version | ||
RUN yarn set version 3.6.3 | ||
|
||
# Copy root files | ||
COPY --chown=1000:1000 package.json yarn.lock .yarnrc.yml ./ | ||
|
||
# Copy yarn files | ||
COPY --chown=1000:1000 .yarn/cache .yarn/cache | ||
COPY --chown=1000:1000 .yarn/releases .yarn/releases | ||
COPY --chown=1000:1000 .yarn/plugins .yarn/plugins | ||
COPY --chown=1000:1000 package.json deno.json deno.lock ./ | ||
|
||
# Copy package.jsons from packages | ||
COPY --chown=1000:1000 packages/backend/package.json packages/backend/package.json | ||
COPY --chown=1000:1000 packages/frontend/package.json packages/frontend/package.json | ||
COPY --chown=1000:1000 packages/types/package.json packages/types/package.json | ||
|
||
# Copy deno.jsons from packages | ||
COPY --chown=1000:1000 packages/backend/deno.json packages/backend/deno.json | ||
COPY --chown=1000:1000 packages/frontend/deno.json packages/frontend/deno.json | ||
COPY --chown=1000:1000 packages/types/deno.json packages/types/deno.json | ||
|
||
# Install node_modules | ||
RUN yarn install || { cat /tmp/**/build.log; exit 1; } | ||
RUN deno install --allow-scripts | ||
|
||
# Copy package sources | ||
COPY --chown=1000:1000 tsconfig.json ./ | ||
COPY --chown=1000:1000 packages packages | ||
COPY --chown=1000:1000 scripts scripts | ||
|
||
# Build packages | ||
RUN npm run build |
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
Oops, something went wrong.