Browse Source

Dockerfile: install tzdata first

pull/784/head
Philip H 3 years ago
committed by pheiduck
parent
commit
f2b0a996dc
  1. 12
      Dockerfile

12
Dockerfile

@ -3,6 +3,9 @@
FROM docker.io/library/node:18-alpine AS build_node_modules FROM docker.io/library/node:18-alpine AS build_node_modules
# Use Timezone from Docker Host
RUN apk add --no-cache tzdata
# Copy Web UI # Copy Web UI
COPY src/ /app/ COPY src/ /app/
WORKDIR /app WORKDIR /app
@ -13,6 +16,9 @@ RUN npm ci --omit=dev
FROM docker.io/library/node:18-alpine FROM docker.io/library/node:18-alpine
COPY --from=build_node_modules /app /app COPY --from=build_node_modules /app /app
# Use Timezone from Docker Host
COPY --from=build_node_modules /usr/share/zoneinfo /usr/share/zoneinfo
# Move node_modules one directory up, so during development # Move node_modules one directory up, so during development
# we don't have to mount it in a volume. # we don't have to mount it in a volume.
# This results in much faster reloading! # This results in much faster reloading!
@ -27,7 +33,6 @@ RUN npm i -g nodemon
# Install Linux packages # Install Linux packages
RUN apk add --no-cache \ RUN apk add --no-cache \
tzdata \
dpkg \ dpkg \
dumb-init \ dumb-init \
iptables \ iptables \
@ -37,11 +42,6 @@ RUN apk add --no-cache \
# Use iptables-legacy # Use iptables-legacy
RUN update-alternatives --install /sbin/iptables iptables /sbin/iptables-legacy 10 --slave /sbin/iptables-restore iptables-restore /sbin/iptables-legacy-restore --slave /sbin/iptables-save iptables-save /sbin/iptables-legacy-save RUN update-alternatives --install /sbin/iptables iptables /sbin/iptables-legacy 10 --slave /sbin/iptables-restore iptables-restore /sbin/iptables-legacy-restore --slave /sbin/iptables-save iptables-save /sbin/iptables-legacy-save
# Use Timezone from Docker Host
COPY --from=build_node_modules \
/usr/share/zoneinfo \
/usr/share/zoneinfo
# Expose Ports # Expose Ports
EXPOSE 51820/udp EXPOSE 51820/udp
EXPOSE 51821/tcp EXPOSE 51821/tcp

Loading…
Cancel
Save