batman
This commit is contained in:
commit
66f9ce3614
33 changed files with 2271 additions and 0 deletions
33
Dockerfile
Normal file
33
Dockerfile
Normal file
|
@ -0,0 +1,33 @@
|
|||
# Use Python 3.9 slim image
|
||||
FROM python:3.9-slim
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE 1
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
ENV FLASK_APP app
|
||||
ENV FLASK_ENV production
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc \
|
||||
libpq-dev \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python packages
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
# Create a non-root user to run the application
|
||||
RUN adduser --disabled-password --gecos "" netviz
|
||||
RUN chown -R netviz:netviz /app
|
||||
USER netviz
|
||||
|
||||
# Run gunicorn with 4 workers
|
||||
CMD gunicorn --bind 0.0.0.0:5000 --workers 4 "app:create_app()"
|
Loading…
Add table
Add a link
Reference in a new issue