-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (34 loc) · 984 Bytes
/
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
# ==== CONFIGURE =====
# Use a Node 16 base image to build apps
FROM node:16-alpine AS build
# Set the working directory to /app inside the container
WORKDIR /apps
# Copy app files
COPY ./ui ./ui
COPY ./server ./server
COPY ./package.json .
COPY ./yarn.lock .
COPY ./.yarn ./.yarn
COPY ./.yarnrc.yml .
# ==== BUILD =====
# Install dependencies (npm ci makes sure the exact versions in the lockfile gets installed)
RUN yarn install --frozen-lockfile
WORKDIR /apps/ui
RUN yarn install --frozen-lockfile
RUN yarn build
WORKDIR /apps/server
#RUN yarn install --frozen-lockfile
RUN yarn build
WORKDIR /apps
# Use a nginx to server apps
FROM node:16-alpine
COPY --from=build /apps/server/dist /apps/server
#COPY --from=build /apps/server/node_modules /apps/server/node_modules
COPY --from=build /apps/ui/build /apps/server/ui
RUN apk update
RUN apk add
RUN apk add ffmpeg
WORKDIR /apps/server
RUN yarn install --production
EXPOSE 8000
CMD ["node", "/apps/server/server/index.js"]