Production dockerfile

This commit is contained in:
2023-02-20 13:45:56 +01:00
parent dfe86fc47f
commit 3d435ffbf2
2 changed files with 29 additions and 2 deletions

View File

@@ -20,8 +20,10 @@ services:
DEFAULT_USER_PASSWORD: "SignLanguageTool123!"
frontend:
build: ./frontend
build:
context: ./frontend
dockerfile: Dockerfile_prod
ports:
- "3000:3000"
- "3000:80"
environment:
REACT_APP_BACKEND_URL: "http://192.168.1.171:8000"

25
frontend/Dockerfile_prod Normal file
View File

@@ -0,0 +1,25 @@
# Build environment
FROM node:14.17.6-alpine3.14 as build
WORKDIR /app
COPY package*.json ./
RUN npm install --silent
COPY . .
RUN npm run build
# Production environment
FROM node:14.17.6-alpine3.14
WORKDIR /app
COPY --from=build /app/build .
RUN npm install -g serve
EXPOSE 80
CMD ["serve", "-s", "."]