-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
45 lines (30 loc) · 942 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
# https://dev.to/alex_barashkov/using-docker-for-nodejs-in-development-and-production-3cgp
# https://medium.com/@kahana.hagai/docker-compose-with-node-js-and-mongodb-dbdadab5ce0a
# The instructions for the first stage
FROM node:20-alpine as builder
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
# fix #233
RUN mkdir scripts
RUN echo "exit 0" > scripts/post-install.sh
RUN chmod +x scripts/post-install.sh
RUN apk --no-cache add python3 make g++
COPY ./package*.json ./
RUN npm install
# ------------------------------------
# The instructions for second stage
FROM node:20-alpine
WORKDIR /opt/OpenHaus/backend
COPY --from=builder node_modules node_modules
RUN apk --no-cache add openssl
ARG version=unknown
LABEL version=$version
ARG buildDate=unknown
LABEL buildDate=$buildDate
COPY ./build/ ./
#COPY ./package.json ./
#ENV HTTP_PORT=8080
ENV NODE_ENV=production
#ENV DB_HOST=10.0.0.1
#EXPOSE 8080
CMD ["node", "index.js"]