Skip to content

Commit 007e28a

Browse files
committed
Setup proper directory permission in dockerfile and mark volume
1 parent 241fcf9 commit 007e28a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ WORKDIR /app
1212
# Install system dependencies and clean up in one layer
1313
RUN apt-get update \
1414
&& apt-get install -y --no-install-recommends \
15-
libpq5 \
16-
curl \
17-
postgresql-client \
15+
libpq5 \
16+
curl \
17+
postgresql-client \
1818
&& rm -rf /var/lib/apt/lists/*
1919

2020
# Install Python dependencies
@@ -32,14 +32,22 @@ COPY . .
3232
# Make entrypoint script executable
3333
RUN chmod +x /app/entrypoint.sh
3434

35+
3536
# Create a non-root user
3637
RUN useradd -m appuser && chown -R appuser:appuser /app
38+
39+
# Create data directory with correct permissions
40+
RUN mkdir -p /data && \
41+
chown -R appuser:appuser /data
42+
3743
USER appuser
3844

3945
# Add healthcheck
4046
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
4147
CMD curl -f http://localhost:8000/health/ || exit 1
4248

49+
VOLUME ["/data"]
50+
4351
# Expose port
4452
EXPOSE 8000
4553

0 commit comments

Comments
 (0)