forked from Sherlockouo/music
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.server
40 lines (32 loc) · 1.09 KB
/
Dockerfile.server
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
# Dockerfile.builder for building the web (React) project
FROM node:20.0.0 AS builder
ENV NODE_ENV=production \
ELECTRON_WEB_SERVER_PORT=42710 \
ELECTRON_DEV_NETEASE_API_PORT=30001 \
UNBLOCK_SERVER_PORT=30003 \
VITE_APP_NETEASE_API_URL=/netease
# Set registry for npm
RUN npm config set registry https://registry.npmmirror.com/
RUN pnpm config set registry https://registry.npmmirror.com/
# Install global dependencies
RUN npm i -g pnpm prisma fastify-cli turbo tsx
# Copy package.json and install dependencies for the main app
COPY package.json /app/
WORKDIR /app
RUN pnpm i
RUN pnpm prune --prod
# Copy package.json and install dependencies for the server
# Copy the built server code
COPY packages/server/dist /app/
COPY packages/server/prisma /app/packages/server/prisma/
COPY packages/server/package.json /app/packages/server/
WORKDIR /app/packages/server/
RUN pnpm i
RUN pnpm prune --prod
# WORKDIR /app/
# RUN prisma generate
# Generate Prisma client
WORKDIR /app/packages/
EXPOSE 35530
# Start the server
CMD ["sh", "-c", "fastify start --port 35530 --address 0.0.0.0 -l info server/src/app.js"]