test
This commit is contained in:
19
Dockerfile
19
Dockerfile
@@ -21,6 +21,16 @@ RUN pip install --no-cache-dir -r requirements.txt
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
# Debug: List files and check tasks.py
|
||||
RUN ls -la /app && \
|
||||
echo "Checking tasks.py:" && \
|
||||
if [ -f /app/tasks.py ]; then \
|
||||
echo "tasks.py exists" && \
|
||||
cat /app/tasks.py; \
|
||||
else \
|
||||
echo "tasks.py does not exist"; \
|
||||
fi
|
||||
|
||||
# Create necessary directories and set permissions
|
||||
RUN mkdir -p /app/uploads /app/static/uploads && \
|
||||
chown -R celery:celery /app
|
||||
@@ -49,6 +59,15 @@ echo "Starting application..."\n\
|
||||
exec "$@"' > /app/entrypoint.sh && \
|
||||
chmod +x /app/entrypoint.sh
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONPATH=/app
|
||||
ENV FLASK_APP=app.py
|
||||
ENV FLASK_ENV=production
|
||||
|
||||
# Make sure tasks.py is executable and has correct permissions
|
||||
RUN chmod 644 /app/tasks.py && \
|
||||
chown celery:celery /app/tasks.py
|
||||
|
||||
# Switch to non-root user
|
||||
USER celery
|
||||
|
||||
|
||||
Reference in New Issue
Block a user