forked from bespoke-surf/bespoke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.server
42 lines (27 loc) · 910 Bytes
/
Dockerfile.server
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
# build the server
FROM node:lts-alpine as builder
RUN apk add --no-cache libc6-compat
WORKDIR /usr/app
COPY ./package.json .
COPY ./turbo.json .
COPY ./packages/server ./packages/server
COPY ./packages/common ./packages/common
RUN yarn install
RUN yarn run build:server
#################################################################
FROM node:lts-alpine
RUN apk add --no-cache libc6-compat
COPY --from=builder /usr/app/packages/server/dist ./usr/app/packages/server/dist
COPY --from=builder /usr/app/packages/common/dist ./usr/app/packages/common/dist
WORKDIR /usr/app
COPY ./package.json .
COPY ./packages/common/package.json ./packages/common/
COPY ./packages/server/package.json ./packages/server/
RUN yarn install --production
WORKDIR /usr/app/packages/server
ENV NODE_ENV=production
ENV PORT=8080
ENV TZ=UTC
ENV COOKIE_NAME=_bespoke-cookie
EXPOSE 8080
CMD ["node","dist/src/main.js"]