This repository was archived by the owner on Feb 15, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
72 lines (56 loc) · 2.03 KB
/
Dockerfile
File metadata and controls
72 lines (56 loc) · 2.03 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM node:25.2.1-alpine AS builder
WORKDIR /usr/src/app
RUN apk update && apk upgrade --no-cache
RUN apk add --no-cache \
ca-certificates \
postgresql-client \
python3 \
make \
g++ \
gcc \
musl-dev \
openssl-dev \
pkgconfig
COPY package.json package-lock.json* ./
RUN --mount=type=cache,target=/root/.npm \
if [ -f package-lock.json ]; then npm ci --no-audit --prefer-offline; \
else npm install --no-audit --prefer-offline; fi
COPY . .
ENV POSTGRESQL_HOST=127.0.0.1
ENV POSTGRESQL_PORT=5432
ENV POSTGRESQL_USER=postgres
ENV POSTGRESQL_PASSWORD=postgres
ENV POSTGRESQL_NAME=pjsedb
ENV POSTGRESQL_SSL=disable
ENV SALT='super-secret-salt-at-least-32-characters-long-0000'
ENV SERVER_KEY='super-secret-server-key-000000000000'
ENV NODE_ENV=production
RUN npm run prepare || true
RUN npm run drizzle:generate
RUN npm run build
FROM node:25.2.1-alpine AS runtime
WORKDIR /usr/src/app
RUN apk update && apk upgrade --no-cache
RUN apk add --no-cache \
ca-certificates \
libstdc++ \
postgresql-client \
su-exec
COPY --from=builder /usr/src/app/package.json ./
COPY --from=builder /usr/src/app/package-lock.json ./
RUN apk add --no-cache --virtual .build-deps make g++ gcc musl-dev openssl-dev python3 \
&& if [ -f package-lock.json ]; then npm ci --omit=dev --no-audit --no-fund; \
else npm install --production --no-audit --no-fund; fi \
&& npm cache clean --force \
&& rm -rf /tmp/* /root/.npm \
&& apk del .build-deps
COPY --from=builder --chown=node:node /usr/src/app/build ./build
COPY --from=builder --chown=node:node /usr/src/app/docker-entrypoint.sh ./docker-entrypoint.sh
COPY --from=builder --chown=node:node /usr/src/app/.env.example ./.env.example
COPY --from=builder --chown=node:node /usr/src/app/exchanges ./exchanges
COPY --from=builder --chown=node:node /usr/src/app/drizzle ./drizzle
RUN chmod +x /usr/src/app/docker-entrypoint.sh
EXPOSE 8000
RUN mkdir -p /usr/src/app/logs && chown -R node:node /usr/src/app/logs
ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]
CMD ["node", "build"]