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
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ version: '3.8'
|
||||
services:
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
context: https://git.kobeamerijckx.com/Kobe/docupulse
|
||||
dockerfile: Dockerfile
|
||||
command: gunicorn --bind 0.0.0.0:5000 app:app
|
||||
ports:
|
||||
@@ -11,6 +11,7 @@ services:
|
||||
environment:
|
||||
- FLASK_APP=app.py
|
||||
- FLASK_ENV=production
|
||||
- PYTHONPATH=/app
|
||||
- DATABASE_URL=postgresql://postgres:postgres@db:5432/docupulse
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
@@ -73,6 +74,7 @@ services:
|
||||
environment:
|
||||
- FLASK_APP=app.py
|
||||
- FLASK_ENV=production
|
||||
- PYTHONPATH=/app
|
||||
- DATABASE_URL=postgresql://postgres:postgres@db:5432/docupulse
|
||||
- REDIS_URL=redis://redis:6379/0
|
||||
depends_on:
|
||||
|
||||
Reference in New Issue
Block a user