-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod
37 lines (28 loc) · 953 Bytes
/
Dockerfile.prod
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
# syntax=docker/dockerfile:1
FROM node:18-slim
LABEL maintainer="Plone Community <[email protected]>" \
org.label-schema.name="frontend-prod-config" \
org.label-schema.description="Slim image for Plone frontend deployments" \
org.label-schema.vendor="Plone Foundation"
# Install busybox and wget
RUN <<EOT
set -e
apt update
apt install -y --no-install-recommends busybox wget git
busybox --install -s
rm -rf /var/lib/apt/lists/*
mkdir /app
chown -R node:node /app
EOT
# Run the image with user node
USER node
# Set working directory to /app
WORKDIR /app
# Expose default Express port
EXPOSE 3000
# Set healthcheck to port 3000
HEALTHCHECK --interval=10s --timeout=5s --start-period=30s CMD [ -n "$LISTEN_PORT" ] || LISTEN_PORT=3000 ; wget -q http://127.0.0.1:"$LISTEN_PORT" -O - || exit 1
# Entrypoint would be yarn
ENTRYPOINT [ "yarn" ]
# And the image will run in production mode
CMD ["start:prod"]