Skip to content
Snippets Groups Projects
Commit 3a175299 authored by Falk's avatar Falk :ping_pong:
Browse files

chore: fix Dockerfile setup

- move Dockerfile to root dir
- set correct default port for node server
- include node_modules folder in final docker build
parent 762e7724
No related branches found
No related tags found
No related merge requests found
Dockerfile
node_modules
.git
......@@ -4,13 +4,13 @@ FROM node:12.16.3 as clientbuild
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
COPY package*.json ./
COPY ./app/client/package*.json ./
ENV PATH /usr/src/app/node_modules/.bin:$PATH
ENV API_URL todo-application-service:3002
RUN npm install --silent
COPY . .
COPY ./app/client .
RUN API_URL=$API_URL node scripts/build.js
# Client build finished
......@@ -19,9 +19,9 @@ RUN API_URL=$API_URL node scripts/build.js
FROM node:12.16.3
WORKDIR "/usr/app"
COPY package*.json ./
COPY package*.json .
RUN npm install --production
COPY . .
COPY ./app/server .
# Copy client app into public folder
COPY --from=clientbuild /usr/src/app/build ./public
......
......@@ -12,7 +12,7 @@ const healthRoute = require('./routes/health.js');
let cookieParser = require('cookie-parser');
const app = express();
const port = process.env.PORT || 5000;
const port = process.env.PORT || 3002;
const corsOptions = {
origin: `http://localhost:${ port }`,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment