Skip to content

Commit

Permalink
update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
squi-ddy committed Sep 16, 2023
1 parent 9f61e1e commit 1d73f8d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
FROM node:14
WORKDIR /usr/src/app
COPY . .
FROM node:14-alpine as build
WORKDIR /app
COPY ./frontend .
RUN npm install
RUN npm run build

FROM node:14-alpine as deploy
WORKDIR /usr/src/app/backend
COPY ./backend .
COPY --from=build /app/dist ./public
RUN npm run docker
EXPOSE 8080
CMD [ "npm", "start" ]
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build_front": "cd ../frontend && npm install && npm run build && node copy.js",
"start": "node dist/bin/www",
"test": "echo \"Error: no test specified\" && exit 1",
"docker": "npm install && npm run build"
"docker": "npm install && tsc"
},
"dependencies": {
"apicache": "^1.6.2",
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2
version: "3.8"

networks:
primary:
Expand Down

0 comments on commit 1d73f8d

Please sign in to comment.