-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (34 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
50 lines (34 loc) · 1.09 KB
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
# 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:22-alpine AS builder
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
# fix #233
RUN mkdir scripts
RUN echo -e "#!/bin/sh\n\nexit 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 pkg delete scripts.prepare
RUN npm install
# ------------------------------------
# The instructions for second stage
FROM node:22-alpine
WORKDIR /opt/OpenHaus/backend
COPY --from=builder node_modules node_modules
RUN apk --no-cache add openssl tzdata tar
# copy binaries to default bin_path location
RUN cp /bin/tar /usr/bin/tar
RUN cp /usr/local/bin/npm /usr/bin/npm
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"]