-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
36 lines (31 loc) · 1.06 KB
/
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
35
36
# prepare dependencies
FROM node:20-slim AS dependencies
WORKDIR /home/node
RUN corepack enable
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --production && \
mv node_modules prod_node_modules && \
yarn install --frozen-lockfile
## tests
# FROM dependencies AS test
# WORKDIR /usr/src/app
# COPY . .
# RUN yarn test-sqlite
## build
# FROM node:20-slim AS build
# WORKDIR /usr/src/app
# COPY package.json yarn.lock ./
# COPY --from=dependencies /app/node_modules ./node_modules
# COPY . .
# ENV NODE_ENV=production
# RUN yarn build --production
# RUN yarn pack --filename /tmp/package.tgz
## production
FROM node:20-slim
# RUN --mount=type=bind,from=build,source=/tmp/package.tgz,target=/tmp/package.tgz \
# tar xf /tmp/package.tgz --owner node --group node -C /home/node --strip-components 1
ADD releases/latest.tgz /home/node/
COPY --from=dependencies /home/node/prod_node_modules /home/node/package/node_modules
RUN ln -s /home/node/package/server/cli.js /usr/local/bin/gancio
EXPOSE 13120
ENTRYPOINT ["/home/node/package/server/cli.js"]