fix: new frontend dev.dockerfile

#21
This commit is contained in:
Gabriel Almeida 2023-03-19 11:11:47 -03:00
commit 48baeb127d
2 changed files with 15 additions and 10 deletions

View file

@ -18,9 +18,7 @@ services:
ports: ports:
- "3000:3000" - "3000:3000"
volumes: volumes:
- ./src/frontend:/app - ./src/frontend/public:/home/node/app/public
# Set process.env.BACKEND to the backend service - ./src/frontend/src:/home/node/app/src
environment: - ./src/frontend/package.json:/home/node/app/package.json
- BACKEND_HOST="http://backend"
- BACKEND_PORT="7860"
restart: on-failure restart: on-failure

View file

@ -1,6 +1,13 @@
FROM node:19-alpine as frontend_build #baseline
ARG BACKEND FROM node:19-alpine AS base
WORKDIR /app RUN mkdir -p /home/node/app
COPY . /app RUN chown -R node:node /home/node && chmod -R 770 /home/node
RUN npm install WORKDIR /home/node/app
# client build
FROM base AS builder-client
WORKDIR /home/node/app
COPY --chown=node:node . ./
USER node
RUN npm install --loglevel warn
CMD ["npm", "start"] CMD ["npm", "start"]