-
-
Notifications
You must be signed in to change notification settings - Fork 201
/
Copy pathdockerfile
59 lines (46 loc) · 1.35 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM node:22-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-distutils \
python3-dev \
make \
g++ \
gcc \
git \
libssl-dev \
build-essential
WORKDIR /app
ENV NEXT_PRIVATE_STANDALONE true
COPY package.json pnpm-lock.yaml ./
COPY prisma ./
RUN npm install -g [email protected] && \
if [ "$USE_MIRROR" = "true" ]; then \
echo "Using mirror registry..." && \
npm install -g nrm && \
nrm use taobao; \
fi && \
pnpm install
COPY . .
RUN pnpm build
RUN pnpm build-seed
FROM node:22-slim AS runner
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
tzdata \
openssl
RUN npm install -g prisma
WORKDIR /app
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/package.json ./
COPY --from=builder /app/seed.js ./seed.js
COPY --from=builder /app/resetpassword.js ./resetpassword.js
COPY --from=builder /app/node_modules/@libsql/linux-arm64-gnu ./node_modules/@libsql/linux-arm64-gnu
ENV NODE_ENV=production \
PORT=1111
EXPOSE 1111
CMD ["sh", "-c", "prisma migrate deploy && node seed.js && node server.js"]