forked from bloom-housing/bloom
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.sites-partners
67 lines (48 loc) · 2.25 KB
/
Dockerfile.sites-partners
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
FROM node:14.17-alpine AS development
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /usr/src/app/
# Copy all the source code from the root of the repo into the container
COPY . ./
WORKDIR /usr/src/app/sites/partners
COPY sites/partners/package.json ./
COPY sites/partners/yarn*.lock ./
COPY sites/partners/tsconfig*.json ./
COPY sites/partners/*config.js ./
RUN yarn install --frozen-lockfile
COPY sites/partners .
# If not defined, use our production backend site for build-time rendering.
# In order to override it for local development when building the image on
# its own, use --build-arg BACKEND_API_BASE=<override>.
ARG BACKEND_API_BASE=https://backend-core-tj3gg4i5eq-uc.a.run.app
ARG PUBLIC_BASE_URL=https://sites-public-tj3gg4i5eq-uc.a.run.app
ARG SHOW_LM_LINKS=TRUE
ARG LANGUAGES=en,es,ar,bn
RUN yarn build
FROM node:14.17-alpine AS production
# Use the NEXTJS_PORT variable as the PORT if defined, otherwise use PORT.
ENV NEXTJS_PORT=3001
ENV PORT=${NEXTJS_PORT}
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
WORKDIR /usr/src/app/
# We need to copy the source code for backend/core and ui-components as well in order
# to ensure that breaking changes in local dependencies from those packages are included
# instead of being pulled from npm.
COPY backend/core ./backend/core
COPY --from=development /usr/src/app/package.json ./
COPY --from=development /usr/src/app/yarn*.lock ./
COPY --from=development /usr/src/app/tsconfig*.json ./
COPY --from=development /usr/src/app/node_modules ./node_modules
WORKDIR /usr/src/app/sites/partners
COPY sites/partners .
COPY --from=development /usr/src/app/sites/partners/next.config.js ./next.config.js
COPY --from=development /usr/src/app/sites/partners/public ./public
COPY --from=development /usr/src/app/sites/partners/.next ./.next
COPY --from=development /usr/src/app/sites/partners/node_modules ./node_modules
EXPOSE ${PORT}
# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry.
# ENV NEXT_TELEMETRY_DISABLED 1
CMD yarn next start -p ${PORT}