-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve deployment stage time execution + prevent loosing data in prod
- Loading branch information
dlavaury
committed
Feb 1, 2024
1 parent
ebe3767
commit ec65d65
Showing
6 changed files
with
37 additions
and
19 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,8 +1,32 @@ | ||
# Dockerfile server | ||
FROM node:16.14 | ||
#syntax=docker/dockerfile:1.4 | ||
FROM node:20-alpine | ||
|
||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | ||
# hadolint ignore=DL3018 | ||
RUN apk add --no-cache libc6-compat | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY ./ . | ||
RUN corepack enable && \ | ||
corepack prepare --activate pnpm@latest && \ | ||
pnpm config -g set store-dir /.pnpm-store | ||
|
||
COPY --link ./server/package.json ./server/ | ||
COPY --link ./client/package.json ./client/ | ||
|
||
RUN cd client && \ | ||
pnpm fetch && \ | ||
pnpm install | ||
RUN cd server && \ | ||
pnpm fetch && \ | ||
pnpm install | ||
|
||
COPY ./client ./client | ||
|
||
RUN cd client && \ | ||
pnpm run build | ||
|
||
COPY ./server ./server | ||
COPY docker-entry.sh . | ||
|
||
RUN npm install | ||
CMD ["sh","./docker-entry.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
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,5 +1,5 @@ | ||
#!/usr/bin/env sh | ||
|
||
sleep 5 | ||
npm run build | ||
npm start | ||
cd /usr/src/app/server | ||
node migrate.js | ||
node index.js |
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