-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (47 loc) · 1.38 KB
/
Dockerfile
File metadata and controls
59 lines (47 loc) · 1.38 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
FROM node:latest as web_builder
WORKDIR /app/
RUN yarn global add turbo@1.10.16
RUN corepack enable
COPY .yarnrc.yml .yarnrc.yml
COPY . .
RUN turbo prune web --docker
WORKDIR /build/
COPY .yarnrc.yml .yarnrc.yml
RUN cp -r /app/out/json/* .
RUN yarn install
RUN cp -r /app/out/full/* .
RUN turbo build --filter=web
# ------------------------------------------------
FROM node:latest as server_builder
WORKDIR /app/
RUN yarn global add turbo@1.10.16 cargo-cp-artifact
RUN apt update
RUN apt-get install -y \
build-essential \
curl
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN corepack enable
COPY .yarnrc.yml .yarnrc.yml
COPY . .
RUN turbo prune server --docker
WORKDIR /build/
COPY .yarnrc.yml .yarnrc.yml
RUN cp -r /app/out/json/* .
# copy manually the compression package beacuse turbo prune doesn't work with it (because it's rust)
COPY ./packages/compression/ ./packages/compression/
RUN yarn install
RUN cp -r /app/out/full/* .
RUN turbo build --filter=server
RUN yarn workspaces focus --all --production
# ------------------------------------------------
FROM node:latest as runner
WORKDIR /app
COPY --from=server_builder /build .
COPY --from=web_builder /build/apps/web/dist ./public
COPY ./apps/clients ./clients
ENV NODE_ENV="production"
ENV WEB_SERVER_PORT=9513
ENV DATA_FOLDER="/data"
ENV URL=""
CMD ["node","apps/server/dist/server.js"]