diff --git a/Dockerfile b/Dockerfile index 9a583b901..65c8924ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,8 +22,9 @@ EXPOSE 23233/tcp EXPOSE 9418/tcp # Set the default command -ENTRYPOINT [ "/usr/local/bin/soft", "serve" ] +ENTRYPOINT [ "/entrypoint.sh", "/usr/local/bin/soft", "serve" ] -RUN apk update && apk add --update git bash openssh && rm -rf /var/cache/apk/* +RUN apk update && apk add --update git bash openssh su-exec && rm -rf /var/cache/apk/* +COPY entrypoint.sh /entrypoint.sh COPY soft /usr/local/bin/soft diff --git a/docker.md b/docker.md index 63202ab15..b79809d69 100644 --- a/docker.md +++ b/docker.md @@ -19,6 +19,8 @@ docker run \ --publish 23233:23233 \ --publish 9418:9418 \ -e SOFT_SERVE_INITIAL_ADMIN_KEYS="YOUR_ADMIN_KEY_HERE" \ + -e PUID=1000 \ + -e PGID=1000 \ --restart unless-stopped \ charmcli/soft-serve:latest ``` @@ -41,6 +43,8 @@ services: - 9418:9418 environment: SOFT_SERVE_INITIAL_ADMIN_KEYS: "YOUR_ADMIN_KEY_HERE" + PUID: 1000 + PGID: 1000 restart: unless-stopped ``` diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 000000000..d63589c44 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/sh +chown -R ${PUID:-1000}:${PGID:-1000} /soft-serve +exec su-exec "${PUID:-1000}:${PGID:-1000}" "$@"