-
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
Showing
7 changed files
with
32 additions
and
33 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,39 +1,33 @@ | ||
ARG PLATFORM="linux/amd64" | ||
|
||
# Build stage | ||
FROM node:20 AS development | ||
# Development stage | ||
FROM node:20-alpine AS development | ||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
RUN apk add --no-cache postgresql-client git gnupg openjdk17 nodejs | ||
|
||
COPY package.json package-lock.json ./ | ||
RUN npm i | ||
|
||
COPY prisma ./prisma | ||
RUN npx prisma generate | ||
|
||
COPY src tsconfig.json ./ | ||
COPY . ./ | ||
RUN npm run build | ||
|
||
COPY start.sh ./ | ||
|
||
RUN apt-get update && apt-get install postgresql-client gnupg2 -y && apt-get clean | ||
|
||
COPY nodemon.json ./ | ||
|
||
CMD [ "npm", "run", "dev" ] | ||
|
||
# Production stage | ||
FROM --platform=${PLATFORM} node:20-alpine AS production | ||
WORKDIR /app | ||
|
||
COPY --from=development /app/dist ./dist | ||
COPY --from=development /app/prisma ./prisma | ||
COPY --from=development /app/package.json ./ | ||
COPY --from=development /app/package-lock.json ./ | ||
COPY --from=development /app/start.sh ./ | ||
RUN apk add --no-cache postgresql-client | ||
|
||
RUN npm i | ||
COPY --from=development /app/package.json /app/start.sh ./ | ||
COPY --from=development /app/node_modules ./node_modules | ||
RUN npm prune --production | ||
|
||
RUN apk update && apk add postgresql-client && apk cache clean | ||
COPY --from=development /app/prisma ./prisma | ||
COPY --from=development /app/dist ./dist | ||
|
||
CMD [ "npm", "run", "start" ] | ||
CMD [ "sh", "./start.sh" ] |
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 |
---|---|---|
|
@@ -26,6 +26,7 @@ services: | |
- database | ||
volumes: | ||
- .:/app | ||
- /app/node_modules | ||
command: ["npm", "run", "dev"] | ||
|
||
pgadmin: | ||
|
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