diff --git a/Dockerfile b/Dockerfile index e46f532..91bbffd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,13 +2,21 @@ FROM alpine:latest RUN apk update && \ apk upgrade && \ - apk add --no-cache autossh supervisor openssl && \ - rm -rf /var/cache/apk/* + apk add --no-cache autossh supervisor openssl && \ + rm -rf /var/cache/apk/* && \ + adduser -D appuser + RUN mkdir /etc/armorcode -RUN adduser -D appuser +COPY /* /etc/armorcode/ + +RUN chown -R appuser:appuser /etc/armorcode + +RUN sed -i 's/user\s*=\s*root/user=appuser/g' /etc/armorcode/supervisord.conf + +RUN touch /supervisord.log /supervisord.pid -RUN chown -R appuser /etc/armorcode +RUN chown appuser:appuser /supervisord.log /supervisord.pid USER appuser diff --git a/docker-compose.yml b/docker-compose.yml index 022d49b..e09e079 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,4 @@ version: "3.9" services: armorcode-tunnel-1: build: . - restart: always - volumes: - - .:/etc/armorcode \ No newline at end of file + restart: always \ No newline at end of file diff --git a/supervisord.conf.sample b/supervisord.conf.sample index 3258fea..a83add2 100644 --- a/supervisord.conf.sample +++ b/supervisord.conf.sample @@ -2,8 +2,8 @@ [program:ACCESS_JIRA] command=/usr/bin/autossh -M 0 -N -R *:5000:jira.acme.com:443 -i /etc/armorcode/private-key.pem -o "ServerAliveInterval=30" -o "ServerAliveCountMax=3" -o "StrictHostKeyChecking=no" ssh-user@ -user=ssh-user +user=appuser [program:ACCESS_SONARQUBE] command=/usr/bin/autossh -M 0 -N -R *:5001:sonar.acme.com:443 -i /etc/armorcode/private-key.pem -o "ServerAliveInterval=30" -o "ServerAliveCountMax=3" -o "StrictHostKeyChecking=no" ssh-user@ -user=ssh-user +user=appuser