-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (32 loc) · 1.42 KB
/
Copy pathDockerfile
File metadata and controls
42 lines (32 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Use Python 3.11 as base image
FROM python:3.11-slim
# Set timezone
ENV TZ="Europe/Prague"
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
gcc \
libssl-dev \
tzdata \
&& rm -rf /var/lib/apt/lists/*
# Copy the dependency manifests first to leverage Docker cache. The image is
# installed from the hash-pinned lockfile, never from the loose requirements.txt
# floors, so every build resolves to exactly what was last tested. Regenerate
# with scripts/deps-lock.sh after editing requirements.txt.
COPY requirements.txt requirements.lock ./
# Install Python dependencies (fails closed on any hash or version mismatch)
RUN pip install --no-cache-dir --require-hashes -r requirements.lock
# Copy application code
COPY . .
# Create data directory, set permissions, and initialize the database
RUN mkdir -p /app/data && chmod 777 /app/data && python init_mindbaboon_db.py
# Expose port
EXPOSE 5000
# Command to run the application
#CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:5000", "mindbaboon:app", "--log-level", "debug", "--access-logfile", "-", "--error-logfile", "-"]
#CMD ["python", "mindbaboon.py"]
# Link this GHCR package to its source repo (auto-connects on push)
LABEL org.opencontainers.image.source=https://github.com/petronijus/Mindbaboon