-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from AronMarinelli/user/aron/perms-issues
Allow configuration of UID/GID when running the application through Docker, update README.md
- Loading branch information
Showing
5 changed files
with
39 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base | ||
USER $APP_UID | ||
WORKDIR /app | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
|
@@ -20,14 +19,21 @@ RUN dotnet publish "Bitwarden.SecureSync.Application.csproj" -c $BUILD_CONFIGURA | |
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "Bitwarden.SecureSync.Application.dll"] | ||
|
||
ENV PATH="/app:${PATH}" \ | ||
PUID=0 \ | ||
PGID=0 | ||
|
||
RUN set -eux; \ | ||
apt-get update; \ | ||
apt-get install -y gosu; \ | ||
rm -rf /var/lib/apt/lists/*; \ | ||
gosu nobody true | ||
|
||
VOLUME ["/app/config", "/app/data"] | ||
|
||
USER root | ||
RUN chown -R $APP_UID /app | ||
USER $APP_UID | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["/bin/sh", "docker-entrypoint.sh"] | ||
|
||
LABEL org.opencontainers.image.authors="[email protected]" | ||
LABEL org.opencontainers.image.url="https://github.com/AronMarinelli/bitwarden-secure-sync" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
mkdir /.config && mkdir /.config/Bitwarden\ CLI | ||
chown -R ${PUID}:${PGID} /.config/Bitwarden\ CLI | ||
|
||
chown -R ${PUID}:${PGID} /app | ||
exec gosu ${PUID}:${PGID} dotnet /app/Bitwarden.SecureSync.Application.dll |