Skip to content

Commit e1521d7

Browse files
committed
build: remove custom non-root user setup from Dockerfile
- Dropped creation of `appuser` and related ownership changes. - Simplified file permission handling by using default permissions.
1 parent 2fb1e45 commit e1521d7

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

backend/Dockerfile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ RUN apt-get update && \
2121
curl && \
2222
rm -rf /var/lib/apt/lists/*
2323

24-
# Create non-root user and initialize /app with correct permissions
25-
RUN groupadd -g 10001 appuser && \
26-
useradd -u 10001 -g appuser -m -s /bin/bash appuser && \
27-
mkdir /app && chown appuser:appuser /app
28-
2924
WORKDIR /app
3025

3126
# ============================================
@@ -59,14 +54,14 @@ COPY --from=builder /usr/local/bin/uv /usr/local/bin/uvx /usr/local/bin/
5954
COPY --from=builder /app/.venv /app/.venv
6055

6156
# Copy application code with correct ownership
62-
COPY --chown=appuser:appuser . .
57+
COPY . .
6358

6459
# Overwrite config
65-
COPY --chown=appuser:appuser alembic.docker.ini alembic.ini
60+
COPY alembic.docker.ini alembic.ini
6661

6762
# Create files directory
68-
RUN mkdir -p /app/files && chown appuser:appuser /app/files
69-
RUN mkdir -p /app/files/pastes && chown appuser:appuser /app/files/pastes
63+
RUN mkdir -p /app/files
64+
RUN mkdir -p /app/files/pastes
7065

7166
# Switch to non-root user
7267
USER appuser

0 commit comments

Comments
 (0)