-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: try dockerfile without user restrictions
- Loading branch information
Showing
1 changed file
with
14 additions
and
17 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,39 +1,36 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM --platform=linux/amd64 node:18.15.0-alpine as builder | ||
RUN apk add --update --no-cache openssl | ||
USER node | ||
WORKDIR /tmp/build/app | ||
|
||
COPY --chown=node:node package.json ./ | ||
COPY --chown=node:node yarn.lock ./ | ||
COPY package.json ./ | ||
COPY yarn.lock ./ | ||
RUN yarn install | ||
COPY --chown=node:node prisma ./prisma/ | ||
COPY prisma ./prisma/ | ||
RUN yarn prisma generate | ||
COPY --chown=node:node tsconfig.json ./ | ||
COPY --chown=node:node tsconfig.build.json ./ | ||
COPY --chown=node:node src ./src | ||
COPY tsconfig.json ./ | ||
COPY tsconfig.build.json ./ | ||
COPY src ./src | ||
RUN yarn build | ||
|
||
FROM --platform=linux/amd64 node:18.15.0-alpine as ts-node-module-prod | ||
RUN apk add --update --no-cache openssl | ||
USER node | ||
WORKDIR /usr/src/app | ||
|
||
COPY --chown=node:node --from=builder /tmp/build/app/package.json ./ | ||
COPY --chown=node:node --from=builder /tmp/build/app/yarn.lock ./ | ||
COPY --from=builder /tmp/build/app/package.json ./ | ||
COPY --from=builder /tmp/build/app/yarn.lock ./ | ||
RUN yarn install --frozen-lockfile --production | ||
COPY --chown=node:node --from=builder /tmp/build/app/node_modules/@prisma ./node_modules/@prisma | ||
COPY --chown=node:node --from=builder /tmp/build/app/node_modules/.prisma ./node_modules/.prisma | ||
COPY --from=builder /tmp/build/app/node_modules/@prisma ./node_modules/@prisma | ||
COPY --from=builder /tmp/build/app/node_modules/.prisma ./node_modules/.prisma | ||
|
||
FROM --platform=linux/amd64 node:18.15.0-alpine | ||
RUN apk add --update --no-cache openssl | ||
USER node | ||
WORKDIR /usr/src/app | ||
COPY --chown=node:node --from=builder /tmp/build/app/package.json ./ | ||
COPY --chown=node:node --from=ts-node-module-prod /usr/src/app/node_modules ./node_modules | ||
COPY --chown=node:node --from=builder /tmp/build/app/prisma ./prisma | ||
COPY --from=builder /tmp/build/app/package.json ./ | ||
COPY --from=ts-node-module-prod /usr/src/app/node_modules ./node_modules | ||
COPY --from=builder /tmp/build/app/prisma ./prisma | ||
|
||
COPY --chown=node:node --from=builder /tmp/build/app/dist ./ | ||
COPY --from=builder /tmp/build/app/dist ./ | ||
|
||
EXPOSE 3000 | ||
CMD ["main.js"] |