-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (24 loc) · 754 Bytes
/
Dockerfile
File metadata and controls
38 lines (24 loc) · 754 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
34
35
36
37
38
FROM node:22 AS builder
# Install rsync
# RUN apt-get update && apt-get install -y rsync
ENV NODE_ENV=production
WORKDIR /usr/src/build
COPY .yarn/releases .yarn/releases
COPY .yarnrc.yml yarn.lock package.json ./
RUN yarn install --immutable
# Load the cache from the previous build
#RUN --mount=type=cache,target=/yarn-cache \
# rsync -a /yarn-cache/ .yarn/cache/ \
# && yarn install --immutable \
# && rsync -a .yarn/cache/ /yarn-cache
# # Remove rsync
# RUN apt-get remove -y rsync
# # Now we can run the full copy command
COPY . ./
ENV NODE_ENV=production
RUN yarn run build
# TODO: we could slim things down by removing
# dev dependencies here...
EXPOSE 3000
ENV NODE_NO_WARNINGS=1
CMD ["yarn", "node", "dist/server/index.mjs"]