-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (29 loc) · 953 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
FROM node:16.16.0 AS build
WORKDIR /build
COPY . .
RUN apt-get update && apt-get install -y telnet net-tools dnsutils curl &&\
npm i -g @nestjs/cli &&\
yarn install &&\
yarn build
## Runtime env
FROM node:16.16.0 AS runtime
ARG CACHEBUST=1
ARG SRV_DIR=/srv/poor-twitter
WORKDIR $SRV_DIR
ARG NODE_AUTH_TOKEN
ENV NODE_APP_INSTANCE=aws
ENV NODE_PATH=dist/src
ENV PORT=22200
RUN apt-get update && apt-get install -y telnet net-tools dnsutils curl
RUN groupadd -g 2000 appuser &&\
useradd -r -u 2000 -g appuser appuser
COPY --from=build /build/node_modules ./node_modules
COPY --from=build /build/dist ./dist
#COPY --from=build /build/migrations ./migrations
#COPY --from=build /build/seeders ./seeders
COPY --from=build /build/package.json .
COPY --from=build /build/yarn.lock .
#COPY --from=build /build/sequelize-config.js ./sequelize-config.js
RUN chown -R appuser:appuser $SRV_DIR
EXPOSE ${PORT}
CMD ["yarn", "start:prod"]