-
Notifications
You must be signed in to change notification settings - Fork 54
/
Dockerfile
33 lines (29 loc) · 1.26 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
FROM rawmind/alpine-monit:5.25-3
MAINTAINER Raul Sanchez <rawmind@gmail.com>
# Set environment
ENV SERVICE_NAME=traefik \
SERVICE_HOME=/opt/traefik \
SERVICE_VERSION=1.7.9 \
SERVICE_USER=traefik \
SERVICE_UID=10001 \
SERVICE_GROUP=traefik \
SERVICE_GID=10001 \
SERVICE_URL=https://github.com/containous/traefik/releases/download
ENV SERVICE_RELEASE=${SERVICE_URL}/v${SERVICE_VERSION}/traefik_linux-amd64 \
PATH=${PATH}:${SERVICE_HOME}/bin
# Download and install traefik
RUN mkdir -p ${SERVICE_HOME}/bin ${SERVICE_HOME}/etc ${SERVICE_HOME}/log ${SERVICE_HOME}/certs ${SERVICE_HOME}/acme && \
apk add --no-cache libcap && \
cd ${SERVICE_HOME}/bin && \
curl -jksSL "${SERVICE_RELEASE}" -O && \
mv traefik_linux-amd64 traefik && \
touch ${SERVICE_HOME}/etc/rules.toml && \
chmod +x ${SERVICE_HOME}/bin/traefik && \
addgroup -g ${SERVICE_GID} ${SERVICE_GROUP} && \
adduser -g "${SERVICE_NAME} user" -D -h ${SERVICE_HOME} -G ${SERVICE_GROUP} -s /sbin/nologin -u ${SERVICE_UID} ${SERVICE_USER}
ADD root /
RUN chmod +x ${SERVICE_HOME}/bin/*.sh && \
chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SERVICE_HOME} /opt/monit && \
setcap 'cap_net_bind_service=+ep' ${SERVICE_HOME}/bin/traefik
USER $SERVICE_USER
WORKDIR $SERVICE_HOME