-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
31 lines (22 loc) · 737 Bytes
/
Copy pathDockerfile.dev
File metadata and controls
31 lines (22 loc) · 737 Bytes
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
ARG NODE_VERSION
FROM node:$NODE_VERSION
# Initialise arguments and env variables#
ARG APP_PATH
ARG APP_NAME
ARG PNPM_VERSION
ARG PREBUILD
ARG PNPM_INSTALL_OPTIONS
ARG START_SCRIPT
ENV APP_NAME $APP_NAME
ENV START_SCRIPT $START_SCRIPT
# Install pnpm according to provided pnpm version
RUN npm i -g pnpm@$PNPM_VERSION
# Copy source code (of the required app + all packages)
WORKDIR /usr/src/app
COPY ./apps/$APP_PATH/ ./apps/$APP_PATH/
COPY ./libs/ ./libs/
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
# Install dependencies
RUN pnpm --filter $APP_NAME i $PNPM_INSTALL_OPTIONS
# On container start update/install dependencies and run nestjs in debug mode
CMD [ "sh", "-c","pnpm --filter $APP_NAME run $START_SCRIPT" ]