Put the 2 dockerfiles into the repo root
prod:
dockerfile: Dockerfile.web
# no command needed in web side
prod:
dockerfile: Dockerfile.api
command: [...]
# Define base image (you can pin your version here) | |
FROM node:16 | |
# Create app directory | |
WORKDIR /app | |
# copy package files and yarn cache | |
COPY package*.json ./ | |
COPY api/package.json ./api/package.json | |
COPY yarn.lock . | |
COPY .yarn .yarn | |
COPY .yarnrc.yml .yarnrc.yml | |
# Install app dependencies | |
RUN yarn install | |
# copy rest of app source | |
COPY . . |
# Define base image (you can pin your version here) | |
FROM node:16 | |
# Update the system | |
RUN apt-get update -y && \ | |
apt-get upgrade -y && \ | |
apt-get autoremove -y | |
# Install dependencies | |
RUN apt-get install -y python3 make g++ gcc | |
# Create app directory | |
WORKDIR /app | |
# copy package files and yarn cache | |
COPY package*.json ./ | |
COPY web/package.json ./web/package.json | |
COPY yarn.lock . | |
COPY .yarn .yarn | |
COPY .yarnrc.yml .yarnrc.yml | |
# Install app dependencies | |
RUN yarn install | |
# copy rest of app source | |
COPY . . |