more docker changes

This commit is contained in:
2025-06-04 08:09:22 +02:00
parent 4594e6185e
commit baae8ed694
2 changed files with 49 additions and 3 deletions

43
.dockerignore Normal file
View File

@@ -0,0 +1,43 @@
# Git
.git
.gitignore
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# Virtual Environment
venv/
ENV/
# IDE
.idea/
.vscode/
*.swp
*.swo
# Local development
*.log
.env
.env.local
.env.*.local
# Keep start.sh

View File

@@ -14,6 +14,10 @@ RUN useradd -m -u 1000 celery
# Set working directory # Set working directory
WORKDIR /app WORKDIR /app
# Copy start.sh first and set permissions
COPY start.sh .
RUN chmod +x start.sh
# Copy requirements first to leverage Docker cache # Copy requirements first to leverage Docker cache
COPY requirements.txt . COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
@@ -23,11 +27,10 @@ COPY . .
# 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
chmod +x /app/start.sh
# Switch to non-root user # Switch to non-root user
USER celery USER celery
# Set entrypoint # Set entrypoint
ENTRYPOINT ["/app/start.sh"] ENTRYPOINT ["./start.sh"]