2023-10-24 15:29:35 -05:00
|
|
|
# Build step #1: build the React front end
|
|
|
|
FROM node:18 as build-step
|
|
|
|
WORKDIR /frontend
|
|
|
|
ENV PATH /frontend/node_modules/.bin:$PATH
|
2023-11-01 20:12:20 +09:00
|
|
|
COPY frontend/package.json frontend/yarn.lock frontend/tsconfig.json ./
|
2023-10-24 15:29:35 -05:00
|
|
|
COPY frontend/src ./src
|
|
|
|
COPY frontend/public ./public
|
|
|
|
RUN yarn install
|
|
|
|
RUN yarn build --production
|
|
|
|
|
|
|
|
# Build step #2: build an nginx container
|
|
|
|
FROM nginx:stable-alpine
|
|
|
|
COPY --from=build-step /frontend/build /usr/share/nginx/html
|
2023-11-02 16:07:01 +09:00
|
|
|
COPY deployment/nginx.template /etc/nginx/nginx.template
|
|
|
|
|
2023-11-01 20:12:20 +09:00
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|