- Apps and @mancala/core depend on the packages in this repo through link: dependencies instead of the npm releases, so changes no longer need a publish - Root package.json gets a build:packages script that installs and builds both packages - Backend and frontend Docker images are built from the repo root so they can include the packages; compose builds them that way - Metro watches the packages folder and resolves their imports from the app's node_modules
34 lines
626 B
Docker
34 lines
626 B
Docker
# Build from the repo root: docker build -f apps/frontend/Dockerfile .
|
|
FROM node:20-alpine3.19 AS build
|
|
|
|
ARG SERVER_ADDRESS WS_SERVER_ADDRESS
|
|
|
|
WORKDIR /app
|
|
|
|
# Local packages the frontend links to
|
|
COPY package.json ./
|
|
COPY packages packages
|
|
RUN yarn build:packages
|
|
|
|
WORKDIR /app/apps/frontend
|
|
|
|
COPY apps/frontend/package.json ./
|
|
|
|
COPY apps/frontend/yarn.lock ./
|
|
|
|
RUN yarn install
|
|
|
|
COPY apps/frontend ./
|
|
|
|
RUN yarn build
|
|
|
|
FROM nginx:stable-alpine
|
|
|
|
COPY --from=build /app/apps/frontend/dist /usr/share/nginx/html
|
|
|
|
COPY apps/frontend/nginx/nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 3000
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|