-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
49 lines (31 loc) · 1.18 KB
/
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
49
FROM node:23-alpine AS base
# Set the time-zone.
RUN apk add --no-cache tzdata && \
cp /usr/share/zoneinfo/Europe/London /etc/localtime && \
echo "Europe/London" > /etc/timezone && \
apk del tzdata
# Install HTTrack.
RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk add --update httrack@testing && rm -rf /var/cache/apk/*
COPY conf/node /home/node/app
WORKDIR /home/node/app
# Create a development image, from the base image.
# The image is used for local development only.
FROM base AS dev
COPY conf/entrypoint/start-node-dev.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod -R +x /usr/local/bin/docker-entrypoint.sh
RUN mkdir /home/node/app/node_modules && \
chown -R node:node /home/node/app
ENV NODE_ENV=development
USER node
CMD []
# Create a production image, from the base image.
# The image is used for deployment, and can be run locally.
FROM base AS build-prod
# Set the environment to production for install & runtime.
ENV NODE_ENV=production
# Install the node modules.
RUN npm ci --only=prod
USER node
# Execute NodeJS (not NPM script) to handle SIGTERM and SIGINT signals.
CMD ["node", "./server.js"]