mancala/apps/frontend/Dockerfile

34 lines
639 B
Docker
Raw Normal View History

# Build from the repo root: docker build -f apps/frontend/Dockerfile .
2024-10-04 23:31:55 +03:00
FROM node:20-alpine3.19 AS build
ARG SERVER_ADDRESS WS_SERVER_ADDRESS KEYCLOAK_URL
2024-12-08 23:24:22 +03:00
2024-10-04 23:31:55 +03:00
WORKDIR /app
# Local packages the frontend links to
2024-10-04 23:31:55 +03:00
COPY package.json ./
COPY packages packages
RUN yarn build:packages
2024-10-04 23:31:55 +03:00
WORKDIR /app/apps/frontend
COPY apps/frontend/package.json ./
COPY apps/frontend/yarn.lock ./
2024-10-04 23:31:55 +03:00
RUN yarn install
COPY apps/frontend ./
2024-10-04 23:31:55 +03:00
RUN yarn build
FROM nginx:stable-alpine
COPY --from=build /app/apps/frontend/dist /usr/share/nginx/html
2024-10-04 23:31:55 +03:00
COPY apps/frontend/nginx/nginx.conf /etc/nginx/conf.d/default.conf
2024-10-04 23:31:55 +03:00
EXPOSE 3000
CMD ["nginx", "-g", "daemon off;"]