-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
73 lines (50 loc) · 1.75 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
FROM node:16-slim as builder
RUN apt-get update
RUN apt-get install -y openssl
WORKDIR /app
RUN mkdir -p /deploy/bot
RUN mkdir -p /deploy/web
RUN npm i -g @microsoft/rush
COPY ./common ./common
COPY ./rush.json .
COPY ./bot/package.json ./bot/package.json
COPY ./socket-server/package.json ./socket-server/package.json
COPY ./web/package.json ./web/package.json
RUN rush install --purge
COPY . .
ARG VITE_DISCORD_OAUTH_REDIRECT_URI
ARG VITE_HOST
ARG VITE_DISCORD_CLIENT_ID
ARG VITE_DISCORD_CLIENT_SECRET
ARG VITE_STREAMIE_SOCKET_IO_SERVER_URL
ENV VITE_DISCORD_OAUTH_REDIRECT_URI=$VITE_DISCORD_OAUTH_REDIRECT_URI
ENV VITE_HOST=$VITE_HOST
ENV VITE_DISCORD_CLIENT_ID=$VITE_DISCORD_CLIENT_ID
ENV VITE_STREAMIE_SOCKET_IO_SERVER_URL=$VITE_STREAMIE_SOCKET_IO_SERVER_URL
RUN rush build
RUN rush deploy --scenario bot -t /deploy/bot
RUN rush deploy --scenario web -t /deploy/web
# Generate Prisma Client manually (rush deploy does not copy them)
RUN cd /deploy/bot/bot && npx prisma generate
FROM node:16-slim as app
WORKDIR /app
ENV NODE_ENV production
RUN apt-get update
RUN apt-get install -y openssl
COPY --from=builder /deploy/bot bot
COPY --from=builder /deploy/web web
# Application port (optional)
EXPOSE 3000
# Debugging port (optional)
# For remote debugging, add this port to devspace.yaml: dev.ports[*].forward[*].port: 9229
EXPOSE 9229
# Socket.io
EXPOSE 8080
# docker run --rm -it --workdir /app/bot/bot --entrypoint node streamie-rush dist
WORKDIR /app/bot/bot
# Container start command (DO NOT CHANGE and see note below)
CMD ["node", "."]
# To start using a different `npm run [name]` command (e.g. to use nodemon + debugger),
# edit devspace.yaml:
# 1) remove: images.app.injectRestartHelper (or set to false)
# 2) add this: images.app.cmd: ["npm", "run", "dev"]