-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
79 lines (67 loc) · 1.96 KB
/
Dockerfile
File metadata and controls
79 lines (67 loc) · 1.96 KB
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
73
74
75
76
77
78
FROM slocomptech/bi-node:12 as builder
COPY package.json /app/
RUN apk add --no-cache --virtual .build-dependencies \
autoconf \
automake \
build-base \
cmake \
gcc \
g++ \
make \
musl-dev \
python3 && \
ln -s /usr/bin/python3 /usr/bin/python && \
cd /app && \
sudo -u ${CONTAINER_USER} -g ${CONTAINER_USER} npm install ${NPM_ARGS}
FROM slocomptech/bi-node:12
#
# Copy packages from builder
#
COPY --from=builder /app/node_modules /app/node_modules
# Install dependencies
RUN apk add --no-cache docker && \
echo "${CONTAINER_USER} ALL=(ALL) NOPASSWD: $(which docker)" >> /etc/sudoers.d/${CONTAINER_USER}
#
# Arguments
#
ARG BUILD_DATE
ARG NODE_ENV
ARG NPM_ARGS
ARG VCS_REF
ARG VCS_SRC
ARG VERSION
#
# Labels
# @see https://github.com/opencontainers/image-spec/blob/master/annotations.md
# @see https://semver.org/
#
LABEL maintainer="martin.dagarin@gmail.com" \
org.opencontainers.image.authors="Martin Dagarin" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.description="Portainer deployer" \
org.opencontainers.image.documentation="https://github.com/SloCompTech/portainer-deployer" \
org.opencontainers.image.revision=${VCS_REF} \
org.opencontainers.image.source=${VCS_SRC} \
org.opencontainers.image.title="Portainer Deployer" \
org.opencontainers.image.url="https://github.com/SloCompTech/portainer-deployer"\
org.opencontainers.image.vendor="Martin Dagarin" \
org.opencontainers.image.version=${VERSION}
#
# Environment variables
# Don't forget to set NODE_ENV
# @see https://github.com/remy/nodemon/blob/master/bin/postinstall.js (bugfix when installing nodemon)
#
ENV APP_VERSION=${VERSION} \
CONFIG=/config/.env \
IN_DOCKER=true \
NODE_ENV=${NODE_ENV}
#
# s6 overlay scripts
# @see https://github.com/just-containers/s6-overlay
#
COPY root /
# App directory
COPY . /app/
# Fix file permissions
RUN chown -R $CONTAINER_USER:$CONTAINER_USER /app && \
chown -R $CONTAINER_USER:$CONTAINER_USER /defaults