-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (42 loc) · 1.37 KB
/
Dockerfile
File metadata and controls
62 lines (42 loc) · 1.37 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
FROM node:16-slim AS install-socketio
RUN apt-get update \
&& apt-get install --no-install-recommends -y git ca-certificates build-essential g++ python3 fontconfig \
&& apt-get clean
WORKDIR /home
COPY prisma server/package*.json ./
RUN npm install
FROM node:16-slim AS install-nuxt
RUN apt-get update \
&& apt-get install --no-install-recommends -y git ca-certificates build-essential g++ python3 fontconfig \
&& apt-get clean
WORKDIR /home
COPY prisma package*.json ./
RUN npm install
RUN ./node_modules/.bin/prisma generate
FROM node:16-slim AS runtime-nuxt
ENV NUXT_HOST=0.0.0.0
ENV NUXT_PORT=3000
WORKDIR /usr/src/nuxt-app
RUN apt-get update \
&& apt-get install --no-install-recommends -y openssl python3 \
&& apt-get clean
COPY . ./
COPY .env.prod ./.env
COPY --from=install-nuxt /home/node_modules ./node_modules
RUN rm -rf server && npm run build
EXPOSE 3000
ENTRYPOINT [ "node_modules/.bin/nuxt", "start" ]
FROM node:16-slim AS runtime-socketio
WORKDIR /home
RUN apt-get update \
&& apt-get install --no-install-recommends -y openssl \
&& apt-get clean
COPY .env.prod .env
COPY server ./server
COPY types ./types
WORKDIR /home/server
COPY --from=install-socketio /home/node_modules ./node_modules
COPY --from=install-nuxt /home/node_modules/.prisma ./node_modules/.prisma
RUN npm install typescript
EXPOSE 4000
ENTRYPOINT [ "./node_modules/.bin/ts-node", "index.ts" ]