-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.node
72 lines (64 loc) · 1.78 KB
/
Dockerfile.node
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#
# Base image
# @see https://hub.docker.com/_/node
# @see https://github.com/nodejs/docker-node/blob/master/README.md#how-to-use-this-image
# @see https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md
# @see https://hub.docker.com/_/alpine/
#
ARG FROM_IMAGE
FROM ${FROM_IMAGE}
#
# Arguments
#
ARG BUILD_DATE
ARG VCS_REF
ARG VCS_SRC
ARG VERSION
ARG OVERLAY_VERSION="v1.22.1.0"
ARG OVERLAY_ARCH="amd64"
#
# Environment variables
# @see https://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html
# @see https://unix.stackexchange.com/questions/43945/whats-the-difference-between-various-term-variables
# @see https://unix.stackexchange.com/questions/34379/is-home-but-sometimes
# @see https://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/
#
ENV CONTAINER_USER="node" \
CONTAINER_VARS_FILE="/usr/local/etc/bi/vars" \
DOCKER_CONTAINER=true \
HOME="/root" \
NPM_CONFIG_PREFIX=/home/node/.npm-global \
PATH=$PATH:/home/node/.npm-global/bin \
PS1="\[\e]0;\u@\h: \w\a\]\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ " \
TERM="xterm" \
VISUAL="nano"
#
# Install packages
#
RUN apk add --no-cache \
bash \
ca-certificates \
coreutils \
curl \
nano \
shadow \
sudo \
tar \
tzdata
#
# Install s6-overlay
# @see https://github.com/just-containers/s6-overlay
#
RUN curl -o /tmp/s6-overlay.tar.gz -L "https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}.tar.gz" && \
tar xfz /tmp/s6-overlay.tar.gz -C / && \
rm /tmp/s6-overlay.tar.gz
#
# Create working structure
#
RUN mkdir -p /app /config /data /defaults /log && \
chown $CONTAINER_USER:$CONTAINER_USER /app /config /data /defaults /log
#
# Add local files to image
#
COPY root/ /
ENTRYPOINT ["/init"]