commit cb82580f868b629902ba96c7f09f885b7d9c24dc Author: Jens Luedicke <jens.luedicke@gmail.com> Date: Thu Jul 3 22:42:49 2025 +0200 Fix for postgres db migration. #5 commit 6a4505e2db1cdb2cec65e630b63535ba08c02fc4 Author: Jens Luedicke <jens.luedicke@gmail.com> Date: Thu Jul 3 22:39:58 2025 +0200 Fix for postgres db migration. #4 commit 7d9a5bb12c591182e67d7d52f90d6b1a45260d9f Author: Jens Luedicke <jens.luedicke@gmail.com> Date: Thu Jul 3 22:38:02 2025 +0200 Fix for postgres db migration. #3 commit 29dbb8b62d873dfbc4901b21e637a7181d545ec7 Author: Jens Luedicke <jens.luedicke@gmail.com> Date: Thu Jul 3 22:35:08 2025 +0200 Fix for postgres db migration. #2 commit d5afc56290d05f53e06a77366214c605d0989c1d Author: Jens Luedicke <jens.luedicke@gmail.com> Date: Thu Jul 3 22:33:09 2025 +0200 Fix for postgres db migration. commit 936008fe1c56b6e699c4a45b503507b6423e15eb Author: Jens Luedicke <jens.luedicke@gmail.com> Date: Thu Jul 3 21:46:32 2025 +0200 Add changes for gunicorn. commit 464c71e5102117f35d05e1504165299ffa50c70c Author: Jens Luedicke <jens.luedicke@gmail.com> Date: Thu Jul 3 20:30:29 2025 +0200 Add changes for Postgres migration.
48 lines
1.2 KiB
Docker
48 lines
1.2 KiB
Docker
FROM python:3.9-slim
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Set environment variables
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
FLASK_APP=app.py
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
gcc \
|
|
build-essential \
|
|
python3-dev \
|
|
postgresql-client \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create www-data user and log directory
|
|
RUN groupadd -r www-data && useradd -r -g www-data www-data || true
|
|
RUN mkdir -p /var/log/uwsgi && chown -R www-data:www-data /var/log/uwsgi
|
|
RUN mkdir -p /host/shared && chown -R www-data:www-data /host/shared
|
|
|
|
# Copy requirements file first for better caching
|
|
COPY requirements.txt .
|
|
|
|
# Install Python dependencies
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
RUN pip install gunicorn==21.2.0
|
|
|
|
# Copy the rest of the application
|
|
COPY . .
|
|
|
|
# Create the SQLite database directory with proper permissions
|
|
RUN mkdir -p /app/instance && chmod 777 /app/instance
|
|
|
|
VOLUME /data
|
|
RUN mkdir /data && chmod 777 /data
|
|
|
|
# Make startup script executable
|
|
RUN chmod +x startup.sh
|
|
|
|
# Expose the port the app runs on (though we'll use unix socket)
|
|
EXPOSE 5000
|
|
|
|
# Use startup script for automatic migration
|
|
CMD ["./startup.sh"] |