-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
48 lines (29 loc) · 978 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
FROM node:20 AS npm
ARG CONTAINER_MODE=app
# Set the working directory to /app
WORKDIR /app
# Copy package.json and package-lock.json to /app
COPY package*.json ./
# Install dependencies
RUN npm install
#########################################################################
FROM node:20
LABEL maintainer="Joseph NOMO <[email protected]>"
RUN npm install -g dotenv
WORKDIR /app
COPY . .
# Copy the dependencies from the npm step to the node step
COPY --from=npm /app/node_modules ./node_modules
# Install supervisord
RUN apt-get update && apt-get install -y supervisor
# Copy supervisord.conf to /etc/supervisor/conf.d/
COPY deployment/supervisord.conf /etc/supervisor/conf.d/
# Copy entrypoint.sh to /
COPY deployment/entrypoint.sh /
# Make entrypoint.sh executable
RUN chmod +x /entrypoint.sh
EXPOSE 3000
# Run supervisord as the entrypoint
ENTRYPOINT ["/entrypoint.sh"]
# Healthcheck command
#HEALTHCHECK CMD curl --fail http://localhost:3000/ || exit 1