mancala/apps/backend/Dockerfile
Halit Aksoy e165b0a0eb build: use local mancala.js and @mancala/core packages
- 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
2026-10-14 02:09:05 +03:00

27 lines
455 B
Docker

# Build from the repo root: docker build -f apps/backend/Dockerfile .
FROM node:lts-buster-slim
ENV PORT=6000
WORKDIR /usr/src/app
# Local packages the backend links to
COPY package.json package.json
COPY packages packages
RUN yarn build:packages
WORKDIR /usr/src/app/apps/backend
COPY apps/backend/package.json package.json
COPY apps/backend/yarn.lock yarn.lock
RUN yarn
COPY apps/backend .
RUN yarn build
EXPOSE ${PORT}
CMD [ "yarn", "start"]