Skip to content

Commit

Permalink
build: copying build files in Dockerfile, reverted changes to fronten…
Browse files Browse the repository at this point in the history
…d npm scripts
  • Loading branch information
SGhotra1 authored and NearW committed Jun 26, 2024
1 parent 5dfcadc commit c0b9106
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
12 changes: 8 additions & 4 deletions packages/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
FROM node:21-alpine3.18 as build
FROM node:21-alpine3.18 AS build
WORKDIR /app
COPY ./ /app/
RUN npm ci
RUN npm run frontend:build

FROM node:21-alpine3.18 as run
FROM node:21-alpine3.18 AS run
WORKDIR /app

COPY --from=build /app/packages/frontend/build/standalone ./
COPY --from=build /app/packages/frontend/build/standalone/packages/frontend ./
COPY --from=build /app/packages/frontend/build/standalone/node_modules ./node_modules
COPY --from=build /app/packages/frontend/build/standalone/packages/shared ./
COPY --from=build /app/packages/frontend/public ./public
COPY --from=build /app/packages/frontend/build/static ./build/static

CMD ["npm", "run", "--prefix", "./packages/frontend", "startstandalone"]
CMD PORT=80 node server.js
5 changes: 2 additions & 3 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build && cp -r public build/standalone/packages/frontend && cp -r build/static build/standalone/packages/frontend/build/static",
"start": "PORT=80 node build/standalone/packages/frontend/server.js",
"startstandalone": "PORT=80 node server.js"
"build": "next build",
"start": "next start -p 80"
},
"dependencies": {
"@emotion/react": "^11.11.4",
Expand Down

0 comments on commit c0b9106

Please sign in to comment.