-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
34 lines (24 loc) · 879 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Node version should match that of your production environment.
FROM node:20.9.0
# Set the Yarn version.
ENV YARN_VERSION 1.22.19
# Set the work directory for the yarn workspace.
WORKDIR /app
# Build arguments to specify the service directory.
ARG SERVICE_DIR
# Set Yarn to the specific version.
RUN yarn policies set-version $YARN_VERSION
# Copy the root package.json and yarn.lock.
COPY package.json .
COPY yarn.lock .
COPY shared-components shared-components
# Copy the service package.json and yarn.lock.
COPY ./${SERVICE_DIR}/package.json ${SERVICE_DIR}/
# Install all workspace dependencies.
RUN yarn install --frozen-lockfile
# Change to the specific service directory.
WORKDIR /app/${SERVICE_DIR}
# Set environment variable to avoid creating source maps for production builds.
ENV GENERATE_SOURCEMAP=false
# Start command for each service.
CMD ["yarn", "dev"]