Skip to content

Commit cb734ed

Browse files
committed
fix bind mount permissions with gosu entrypoint
1 parent 369fdff commit cb734ed

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to ObjeX are documented here.
44

55
---
66

7+
## Unreleased
8+
9+
### Fixed
10+
- Docker bind mount permissions: entrypoint now fixes `/data` ownership via gosu (named volumes unaffected)
11+
- S3 PUT Object returned 201 instead of 200 (broke warp and some SDKs)
12+
- S3 `aws-chunked` transfer encoding not decoded, stored chunk framing as part of object data
13+
- Response compression applied to S3 port, causing size mismatches on download
14+
15+
---
16+
717
## v1.1.0 — 2026-04-09
818

919
### Added

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ RUN dotnet publish ObjeX.Api/ObjeX.Api.csproj \
2323
# Pin to 10.0 — intentional for .NET 10 preview/RC; update when GA lands
2424
FROM mcr.microsoft.com/dotnet/aspnet:10.0
2525

26-
# Install curl for container healthcheck, then clean up
27-
RUN apt-get update && apt-get install -y --no-install-recommends curl \
26+
# Install curl (healthcheck) and gosu (entrypoint privilege drop), then clean up
27+
RUN apt-get update && apt-get install -y --no-install-recommends curl gosu \
2828
&& rm -rf /var/lib/apt/lists/*
2929

3030
WORKDIR /app
3131
RUN mkdir -p /data/db /data/blobs && chown -R app:app /data
3232
COPY --from=build --chown=app:app /app/publish .
3333

34+
# Entrypoint: fix bind mount ownership, then drop to non-root
35+
RUN printf '#!/bin/sh\nif [ "$(id -u)" = "0" ]; then\n chown -R app:app /data 2>/dev/null || true\n exec gosu app dotnet ObjeX.Api.dll "$@"\nelse\n exec dotnet ObjeX.Api.dll "$@"\nfi\n' > /entrypoint.sh && chmod 755 /entrypoint.sh
36+
3437
ENV ASPNETCORE_URLS=http://+:9001
3538
ENV ConnectionStrings__DefaultConnection="Data Source=/data/db/objex.db"
3639
ENV Storage__BasePath="/data/blobs"
@@ -41,5 +44,4 @@ EXPOSE 9000
4144
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
4245
CMD curl -f http://localhost:9001/health || exit 1
4346

44-
USER app
45-
ENTRYPOINT ["dotnet", "ObjeX.Api.dll"]
47+
ENTRYPOINT ["/entrypoint.sh"]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Open **http://localhost:9001** — log in with `admin` / `admin`.
4040

4141
> ⚠️ Change the default admin credentials before exposing the instance publicly. Set `DefaultAdmin:Username`, `DefaultAdmin:Email`, and `DefaultAdmin:Password` in `appsettings.json` or environment variables.
4242
43+
> **Bind mounts:** If using a bind mount instead of a named volume, mount to `/data` (e.g. `./my-data:/data`). The entrypoint automatically fixes ownership for bind mounts.
44+
4345
---
4446
<img width="800" height="496" alt="grafik" src="https://github.com/user-attachments/assets/8cadcd71-de33-4554-a5a0-320362b35e68" />
4547

0 commit comments

Comments
 (0)