Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable prod build #52

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ README.md

node_modules

compose.yaml

compose-test.yaml
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,6 @@ build
.DS_Store

# End of https://www.toptal.com/developers/gitignore/api/node,visualstudiocode

compose.yaml
compose-test.yaml
13 changes: 13 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true
},
"target": "es2016"
},
"module": {
"type": "commonjs"
},
"isModule": true
}
28 changes: 12 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
FROM node:18.8-alpine as base
FROM node:18.8-alpine as builder

FROM base as builder

WORKDIR /home/node/app
WORKDIR /home/node
COPY package*.json ./

COPY . .

RUN npm i -g pnpm
RUN pnpm i

RUN pnpm build
RUN yarn install
RUN yarn build

FROM base as runtime
FROM node:18.8-alpine as runtime

ENV NODE_ENV=production
ENV PAYLOAD_CONFIG_PATH=dist/payload.config.js

WORKDIR /home/node/app
COPY package.json ./
WORKDIR /home/node
COPY package*.json ./

RUN npm i -g pnpm
RUN pnpm i --production
RUN yarn install

COPY --from=builder /home/node/app/dist ./dist
COPY --from=builder /home/node/app/build ./build
COPY --from=builder /home/node/dist ./dist
COPY --from=builder /home/node/build ./build

EXPOSE 3000

CMD ["node", "dist/server.js"]
CMD ["node", "./dist/server.js"]
10 changes: 7 additions & 3 deletions Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ WORKDIR /home/node/app

COPY . .

RUN npm i -g pnpm
RUN pnpm i
#RUN npm i -g pnpm
#RUN pnpm i
RUN npm install

EXPOSE 3000

CMD ["pnpm", "dev"]
#CMD ["pnpm", "dev"]

#CMD ["npm", "dev"]
CMD ["npm", "run", "dev"]
62 changes: 0 additions & 62 deletions compose.yaml

This file was deleted.

Loading