-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
33 lines (21 loc) · 850 Bytes
/
Dockerfile.dev
File metadata and controls
33 lines (21 loc) · 850 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
32
33
ARG NODE_VERSION=20
ARG SERVER_PORT=3001
FROM node:$NODE_VERSION-bookworm as base
WORKDIR /app
FROM base as builder
COPY package.json yarn.lock
RUN yarn install --frozen-lockfile
COPY . .
RUN yarn bootstrap
RUN rm -rf /app/packages/server/dist/ && yarn build --scope=server
FROM node:$NODE_VERSION-bookworm-slim as production
WORKDIR /app
COPY --from=builder /app/packages/client/ /client/
COPY --from=builder /app/packages/server/dist/ /app/
COPY --from=builder /app/packages/server/package.json /app/package.json
COPY --from=builder /app/packages/server/utils/wait-for.sh /app/utils/wait-for.sh
RUN apt-get -q update && apt-get -qy install netcat-traditional
RUN chmod +x /app/utils/wait-for.sh
RUN sed -i 's/"client": "0.0.0"/"client": "file:..\/client"/g' /app/package.json \
&& yarn install --production=true
EXPOSE $SERVER_PORT