diff --git a/src/Api/Dockerfile b/src/Api/Dockerfile index 085771c388..6fadf02699 100644 --- a/src/Api/Dockerfile +++ b/src/Api/Dockerfile @@ -3,6 +3,7 @@ FROM microsoft/aspnetcore:2.0.5 RUN apt-get update \ && apt-get install -y --no-install-recommends \ cron \ + gosu \ && rm -rf /var/lib/apt/lists/* ENV ASPNETCORE_URLS http://+:5000 @@ -25,5 +26,4 @@ RUN groupadd -g 999 bitwarden \ && chmod +x /entrypoint.sh \ && chown bitwarden:bitwarden /entrypoint.sh -USER bitwarden ENTRYPOINT ["/entrypoint.sh"] diff --git a/src/Api/entrypoint.sh b/src/Api/entrypoint.sh index 392f894225..7dca9d7472 100644 --- a/src/Api/entrypoint.sh +++ b/src/Api/entrypoint.sh @@ -2,4 +2,5 @@ env >> /etc/environment cron -dotnet /app/Api.dll + +gosu bitwarden:bitwarden dotnet /app/Api.dll diff --git a/util/MsSql/Dockerfile b/util/MsSql/Dockerfile index 4113947298..28ffe38b4a 100644 --- a/util/MsSql/Dockerfile +++ b/util/MsSql/Dockerfile @@ -3,6 +3,7 @@ FROM microsoft/mssql-server-linux:2017-CU4 RUN apt-get update \ && apt-get install -y --no-install-recommends \ cron \ + gosu \ && rm -rf /var/lib/apt/lists/* RUN groupadd -g 999 bitwarden \ @@ -27,5 +28,4 @@ RUN mkdir -p /etc/bitwarden/mssql/backups \ && chown bitwarden:bitwarden /backup-db.sh \ && chown bitwarden:bitwarden /backup-db.sql -USER bitwarden ENTRYPOINT ["/entrypoint.sh"] diff --git a/util/MsSql/entrypoint.sh b/util/MsSql/entrypoint.sh index 564aa82b3b..00fb8a97c5 100644 --- a/util/MsSql/entrypoint.sh +++ b/util/MsSql/entrypoint.sh @@ -2,4 +2,6 @@ env >> /etc/environment cron -/opt/mssql/bin/sqlservr + +chown -R bitwarden:bitwarden /var/opt/mssql +gosu bitwarden:bitwarden /opt/mssql/bin/sqlservr