Skip to content

Commit 9a97177

Browse files
Update Dockerfile
1 parent 9ed9fb9 commit 9a97177

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@ RUN apt-get update && apt-get install -y \
1818
COPY requirements.txt .
1919
RUN pip install --no-cache-dir -r requirements.txt
2020

21-
# Copy application code
22-
COPY --chown=appuser:appuser . .
21+
# Copy application code with correct ownership
22+
COPY --chown=appuser:appuser app /app/app
23+
COPY --chown=appuser:appuser static /app/static
24+
COPY --chown=appuser:appuser docker-entrypoint.sh /usr/local/bin/
2325

24-
# Create volume for database with proper permissions
26+
# Create data directory with proper permissions
2527
RUN mkdir -p /app/data && chown -R appuser:appuser /app/data
26-
VOLUME ["/app/data"]
28+
29+
# Make entrypoint executable
30+
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
2731

2832
# Set environment variables
2933
ENV FLASK_APP=app.main:create_app
3034
ENV PYTHONUNBUFFERED=1
31-
ENV USER_UID=${USER_UID}
32-
ENV USER_GID=${USER_GID}
33-
34-
# Copy and set permissions for entrypoint script
35-
COPY docker-entrypoint.sh /usr/local/bin/
36-
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
35+
ENV PYTHONPATH=/app
3736

37+
VOLUME ["/app/data"]
3838
EXPOSE 5000
3939

4040
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
41-
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "--threads", "4", "app.main:create_app()"]
41+
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "--threads", "4", "--access-logfile", "-", "--error-logfile", "-", "app.main:create_app()"]

0 commit comments

Comments
 (0)