Skip to content

Production dockerfilesΒΆ

worker/Dockerfile and server/Dockerfile:

FROM node:alpine
WORKDIR "/app"
COPY ./package.json ./
RUN npm install
COPY . .
CMD ["node", "run", "start"]

nginx/Dockerfile:

FROM nginx
COPY ./default.conf /etc/nginx/conf.d/default.conf

client/Dockerfile:

FROM node:alpine as builder
WORKDIR '/app'
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

FROM nginx
EXPOSE 3000
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/build /usr/share/nginx/html

client/nginx/default.conf

server {
    listen 3000;
    location / {
        root /usr/share/nginx/html;
        index index.html index.htm;
        try_files $uri $uri/ /index.html; 
    }
}