meltedchoco commited on
Commit
aa7f8c3
·
verified ·
1 Parent(s): 9b29b82

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -5
Dockerfile CHANGED
@@ -47,22 +47,24 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
47
  && rm -rf /var/lib/apt/lists/* \
48
  && pip install --no-cache-dir uv
49
 
50
- # Create sekai user (1000) and set up directories
51
  RUN groupadd -g 1000 sekai \
52
  && useradd -m -u 1000 -g sekai sekai \
53
- && mkdir -p /data/postgres /data/.cache /var/run/postgresql \
54
- && chown -R sekai:sekai /data /var/run/postgresql
55
 
56
  WORKDIR /app
57
 
58
- # Copy files and immediately give ownership to the sekai user
59
  COPY --from=source --chown=sekai:sekai /src/app /app
60
  COPY --chown=sekai:sekai entrypoint.sh /app/entrypoint.sh
61
 
62
  RUN chmod +x /app/entrypoint.sh
63
 
64
- # Switch to sekai BEFORE running uv sync so the virtual environment is owned by sekai
65
  USER sekai
 
 
66
  RUN uv sync --frozen --no-dev
67
 
68
  EXPOSE 7860
 
47
  && rm -rf /var/lib/apt/lists/* \
48
  && pip install --no-cache-dir uv
49
 
50
+ # Create sekai user (1000) and set up all required directories (including /app!)
51
  RUN groupadd -g 1000 sekai \
52
  && useradd -m -u 1000 -g sekai sekai \
53
+ && mkdir -p /data/postgres /data/.cache /var/run/postgresql /app \
54
+ && chown -R sekai:sekai /data /var/run/postgresql /app
55
 
56
  WORKDIR /app
57
 
58
+ # Copy files (the --chown ensures the files inside are also owned by sekai)
59
  COPY --from=source --chown=sekai:sekai /src/app /app
60
  COPY --chown=sekai:sekai entrypoint.sh /app/entrypoint.sh
61
 
62
  RUN chmod +x /app/entrypoint.sh
63
 
64
+ # IMPORTANT: Switch to the sekai user right here
65
  USER sekai
66
+
67
+ # Now uv sync will run as sekai and have full permission to create /app/.venv
68
  RUN uv sync --frozen --no-dev
69
 
70
  EXPOSE 7860