fix: run container as root to resolve volume permission issue
- Remove non-root user (appuser) to eliminate SQLite database creation failures - Users no longer need to manually create data directory or fix permissions - Version bump to 1.0.3 Fixes #5 Made-with: Cursor
This commit is contained in:
parent
752f555f0c
commit
f9968a4e0d
12
Dockerfile
12
Dockerfile
|
|
@ -21,15 +21,14 @@ FROM python:3.11-slim
|
||||||
|
|
||||||
LABEL maintainer="tmwgsicp"
|
LABEL maintainer="tmwgsicp"
|
||||||
LABEL description="WeChat Official Account Article Download API with RSS Support"
|
LABEL description="WeChat Official Account Article Download API with RSS Support"
|
||||||
LABEL version="1.0.0"
|
LABEL version="1.0.3"
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install runtime dependencies (curl for healthcheck)
|
# Install runtime dependencies (curl for healthcheck)
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
curl \
|
curl \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
&& useradd -m -u 1000 appuser
|
|
||||||
|
|
||||||
# Copy wheels from builder and install
|
# Copy wheels from builder and install
|
||||||
COPY --from=builder /app/wheels /wheels
|
COPY --from=builder /app/wheels /wheels
|
||||||
|
|
@ -38,11 +37,8 @@ RUN pip install --no-cache-dir /wheels/* && rm -rf /wheels
|
||||||
# Copy application code
|
# Copy application code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Create data directory for SQLite and set permissions
|
# Create data directory
|
||||||
RUN mkdir -p /app/data && chown -R appuser:appuser /app
|
RUN mkdir -p /app/data
|
||||||
|
|
||||||
# Switch to non-root user
|
|
||||||
USER appuser
|
|
||||||
|
|
||||||
# Environment variables with sensible defaults
|
# Environment variables with sensible defaults
|
||||||
ENV PYTHONUNBUFFERED=1 \
|
ENV PYTHONUNBUFFERED=1 \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue