-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
54 lines (35 loc) · 1019 Bytes
/
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
FROM node:18-alpine as builder
# Note: Build this from the root directory:
# cd package-manager
# docker build -f apps/http-server/app/Dockerfile -t pm-http-server .
# docker build -t pm-http-server ../../../..
# Environment
WORKDIR /src
# Common
COPY package.json tsconfig.json tsconfig.build.json yarn.lock lerna.json commonPackage.json .yarnrc.yml ./
COPY scripts ./scripts
COPY .yarn ./.yarn
# Shared dependencies
COPY shared ./shared
# App dependencies
RUN mkdir -p apps/http-server
COPY apps/http-server/packages apps/http-server/packages
# App
COPY apps/http-server/app apps/http-server/app
# Install
RUN yarn install
# Build
RUN yarn build
# Purge dev-dependencies:
RUN yarn workspaces focus -A --production
RUN rm -r scripts
# Create deploy-image:
FROM node:18-alpine
COPY --from=builder /src /src
WORKDIR /src/apps/http-server/app
ENV HTTP_SERVER_PORT=8080
# ENV HTTP_SERVER_API_KEY_READ=
# ENV HTTP_SERVER_API_KEY_WRITE=
ENV HTTP_SERVER_BASE_PATH="/data"
EXPOSE 8080
CMD ["yarn", "start"]