-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
112 lines (83 loc) · 2.42 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
# Copying needed files
COPY ./package.json /app/package.json
COPY ./.npmrc /app/.npmrc
COPY ./.nvmrc /app/.nvmrc
COPY ./pnpm-lock.yaml /app/pnpm-lock.yaml
COPY ./pnpm-workspace.yaml /app/pnpm-workspace.yaml
COPY ./turbo.json /app/turbo.json
# Copying needed folders
COPY ./apps /app/apps
COPY ./packages /app/packages
COPY ./internal-packages /app/internal-packages
COPY ./tooling /app/tooling
COPY ./turbo /app/turbo
# FROM base AS prod-deps
# RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
FROM base as dev-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
FROM dev-deps AS build
ENV CI=1
RUN pnpm run build
FROM dev-deps AS build-docs
ENV CI=1
RUN pnpm -F docs build:cf
##########################
# apps/landing #
##########################
FROM build AS landing
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
# COPY --from=prod-deps /app/node_modules /app/node_modules
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["pnpm", "-F", "landing", "start"]
#########################
# apps/nextjs #
#########################
FROM build AS nextjs
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
# COPY --from=prod-deps /app/node_modules /app/node_modules
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["pnpm", "-F", "nextjs", "start"]
##########################
# apps/connect #
##########################
FROM build AS connect
ENV NODE_ENV=production
# COPY --from=prod-deps /app/node_modules /app/node_modules
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["pnpm", "-F", "connect", "start"]
#########################
# apps/master #
#########################
FROM build AS master
ENV NODE_ENV=production
# COPY --from=prod-deps /app/node_modules /app/node_modules
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["pnpm", "-F", "master", "start"]
#########################
# apps/docs #
#########################
# Use the official Nginx image as the base image
FROM nginx:alpine AS docs
# Set the working directory
WORKDIR /app
# Copy the build-docs files from apps/docs/build to Nginx's html directory
COPY --from=build-docs /app/apps/docs/build /usr/share/nginx/html
# Expose port 80 to the outside world
EXPOSE 80
# Start Nginx server
CMD ["nginx", "-g", "daemon off;"]