-
Notifications
You must be signed in to change notification settings - Fork 54
/
Dockerfile
32 lines (28 loc) · 1.22 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
FROM rawmind/alpine-monit:0.5.19-1
MAINTAINER Raul Sanchez <[email protected]>
#Set environment
ENV SERVICE_NAME=traefik \
SERVICE_HOME=/opt/traefik \
SERVICE_VERSION=v1.0.2 \
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}/${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 && \
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