-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (25 loc) · 886 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
FROM node:18.16.0-alpine
# Create app directory
WORKDIR /usr/src/app
# Define graphql server port
ARG ENV_ARG=production
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY ./service/package*.json ./
RUN npm i -g [email protected]
RUN npm install
## Add the wait script to the image
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.7.3/wait /wait
RUN chmod +x /wait
# If you are building your code for production
# RUN npm ci --only=production
# Bundle app source & config files for TypeORM & TypeScript
COPY ./service/src ./src
COPY ./service/tsconfig.json .
COPY ./service/tsconfig.build.json .
COPY ./service/matrix-adapter.yml .
RUN npm run build
ENV NODE_ENV=${ENV_ARG}
EXPOSE 4006
CMD ["/bin/sh", "-c", "npm run start:prod NODE_OPTIONS=--max-old-space-size=2048"]