-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.base
49 lines (36 loc) · 1.16 KB
/
Dockerfile.base
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
FROM --platform=$BUILDPLATFORM node:18-alpine AS builder
RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
RUN yarn global add turbo
COPY . .
RUN turbo prune --scope=@famcomp/server --scope=@famcomp/client --docker
# Add lockfile and package.json's of isolated subworkspace
FROM --platform=$BUILDPLATFORM node:18-alpine AS installer
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app
RUN yarn global add turbo
RUN yarn global add pnpm
# First install the dependencies (as they change less often)
COPY .gitignore .gitignore
COPY --from=builder /app/out/full .
COPY pnpm-lock.yaml ./pnpm-lock.yaml
RUN pnpm install
# Build the project
RUN turbo run build
RUN find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
FROM node:18-alpine AS runner
WORKDIR /app
RUN yarn global add pnpm
RUN apk update
RUN apk add bash nginx
RUN mkdir -p /run/nginx
COPY ./ingress-ha.conf /etc/nginx/nginx.conf
COPY --from=installer /app .
RUN pnpm install --production
EXPOSE 8099
ENV STORAGE_PATH /data/db
ENV SUPERVISOR_URL supervisor/core
CMD [ "/bin/bash", "-c", "nginx -g \"daemon off;\" & node /app/apps/server/dist/index.js" ]