Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FROM python:3.11-slim
- # Set working directory to match the expected path in the application
- WORKDIR /opt/transcription-app
- # Set environment variables
- ENV PYTHONDONTWRITEBYTECODE=1 \
- PYTHONUNBUFFERED=1 \
- FLASK_APP=app.py \
- FLASK_ENV=production
- # Install system dependencies
- RUN apt-get update && apt-get install -y --no-install-recommends \
- gcc \
- && rm -rf /var/lib/apt/lists/*
- # Copy requirements and install Python dependencies
- COPY requirements.txt .
- RUN pip install --no-cache-dir -r requirements.txt
- # Create directories for uploads and database
- RUN mkdir -p /opt/transcription-app/uploads /opt/transcription-app/instance
- RUN chmod 755 /opt/transcription-app/uploads /opt/transcription-app/instance
- # Copy application files
- COPY app.py reset_db.py create_admin.py ./
- COPY templates ./templates/
- # Make scripts executable
- RUN chmod +x create_admin.py reset_db.py
- # Create a non-root user for security
- RUN adduser --disabled-password --gecos '' appuser
- RUN chown -R appuser:appuser /opt/transcription-app
- USER appuser
- # Expose the application port
- EXPOSE 8899
- # Command to run the application with Gunicorn
- CMD ["gunicorn", "--workers", "3", "--bind", "0.0.0.0:8899", "--timeout", "600", "app:app"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement