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 application code
|
||||||
COPY . .
|
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
|
# Create necessary directories and set permissions
|
||||||
RUN mkdir -p /app/uploads /app/static/uploads && \
|
RUN mkdir -p /app/uploads /app/static/uploads && \
|
||||||
chown -R celery:celery /app
|
chown -R celery:celery /app
|
||||||
@@ -49,6 +59,15 @@ echo "Starting application..."\n\
|
|||||||
exec "$@"' > /app/entrypoint.sh && \
|
exec "$@"' > /app/entrypoint.sh && \
|
||||||
chmod +x /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
|
# Switch to non-root user
|
||||||
USER celery
|
USER celery
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ version: '3.8'
|
|||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: https://git.kobeamerijckx.com/Kobe/docupulse
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
command: gunicorn --bind 0.0.0.0:5000 app:app
|
command: gunicorn --bind 0.0.0.0:5000 app:app
|
||||||
ports:
|
ports:
|
||||||
@@ -11,6 +11,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- FLASK_APP=app.py
|
- FLASK_APP=app.py
|
||||||
- FLASK_ENV=production
|
- FLASK_ENV=production
|
||||||
|
- PYTHONPATH=/app
|
||||||
- DATABASE_URL=postgresql://postgres:postgres@db:5432/docupulse
|
- DATABASE_URL=postgresql://postgres:postgres@db:5432/docupulse
|
||||||
- POSTGRES_USER=postgres
|
- POSTGRES_USER=postgres
|
||||||
- POSTGRES_PASSWORD=postgres
|
- POSTGRES_PASSWORD=postgres
|
||||||
@@ -73,6 +74,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- FLASK_APP=app.py
|
- FLASK_APP=app.py
|
||||||
- FLASK_ENV=production
|
- FLASK_ENV=production
|
||||||
|
- PYTHONPATH=/app
|
||||||
- DATABASE_URL=postgresql://postgres:postgres@db:5432/docupulse
|
- DATABASE_URL=postgresql://postgres:postgres@db:5432/docupulse
|
||||||
- REDIS_URL=redis://redis:6379/0
|
- REDIS_URL=redis://redis:6379/0
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
Reference in New Issue
Block a user