cleanup in docker
This commit is contained in:
28
docker/Dockerfile
Normal file
28
docker/Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
||||
FROM python:3.14-trixie
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
tesseract-ocr \
|
||||
tesseract-ocr-pol \
|
||||
libglib2.0-0 \
|
||||
libsm6 \
|
||||
libxrender1 \
|
||||
libxext6 \
|
||||
poppler-utils \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements.txt requirements.txt
|
||||
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
|
||||
#EXPOSE 8000
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
46
docker/Dockerfile.alpine
Normal file
46
docker/Dockerfile.alpine
Normal file
@@ -0,0 +1,46 @@
|
||||
FROM python:3.14-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
RUN apk add --no-cache \
|
||||
tesseract-ocr \
|
||||
tesseract-ocr-data-pol \
|
||||
poppler-utils \
|
||||
libstdc++ \
|
||||
libffi \
|
||||
openssl \
|
||||
postgresql-libs \
|
||||
zlib \
|
||||
jpeg \
|
||||
libpng \
|
||||
openblas \
|
||||
&& apk add --no-cache --virtual .build-deps \
|
||||
build-base \
|
||||
python3-dev \
|
||||
musl-dev \
|
||||
linux-headers \
|
||||
libffi-dev \
|
||||
openssl-dev \
|
||||
postgresql-dev \
|
||||
zlib-dev \
|
||||
jpeg-dev \
|
||||
libpng-dev \
|
||||
openblas-dev \
|
||||
cmake \
|
||||
cargo \
|
||||
rust
|
||||
|
||||
COPY requirements-stable.txt /app/requirements-stable.txt
|
||||
|
||||
RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
|
||||
&& pip install --no-cache-dir -r /app/requirements-stable.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
27
docker/Dockerfile.debian-slim
Normal file
27
docker/Dockerfile.debian-slim
Normal file
@@ -0,0 +1,27 @@
|
||||
FROM python:3.14-slim-trixie
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
tesseract-ocr \
|
||||
tesseract-ocr-pol \
|
||||
libglib2.0-0 \
|
||||
libsm6 \
|
||||
libxrender1 \
|
||||
libxext6 \
|
||||
poppler-utils \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements.txt requirements.txt
|
||||
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
#EXPOSE 8000
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
27
docker/Dockerfile.debian-stable-slim
Normal file
27
docker/Dockerfile.debian-stable-slim
Normal file
@@ -0,0 +1,27 @@
|
||||
FROM python:3.14-slim-trixie
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
tesseract-ocr \
|
||||
tesseract-ocr-pol \
|
||||
libglib2.0-0 \
|
||||
libsm6 \
|
||||
libxrender1 \
|
||||
libxext6 \
|
||||
poppler-utils \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements-stable.txt requirements.txt
|
||||
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
#EXPOSE 8000
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
79
docker/compose.yml
Normal file
79
docker/compose.yml
Normal file
@@ -0,0 +1,79 @@
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: docker/Dockerfile.debian-stable-slim
|
||||
container_name: lista-zakupow-app
|
||||
expose:
|
||||
- "${APP_PORT:-8000}"
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD",
|
||||
"python",
|
||||
"-c",
|
||||
"import urllib.request; import sys; req = urllib.request.Request('http://localhost:${APP_PORT:-8000}/healthcheck', headers={'X-Internal-Check': '${HEALTHCHECK_TOKEN}'}); sys.exit(0) if urllib.request.urlopen(req).getcode() == 200 else sys.exit(1)",
|
||||
]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
env_file:
|
||||
- ../.env
|
||||
volumes:
|
||||
- ../:/app
|
||||
- ../uploads:/app/uploads
|
||||
- ../instance:/app/instance
|
||||
networks:
|
||||
- lista-zakupow_network
|
||||
restart: unless-stopped
|
||||
|
||||
varnish:
|
||||
image: varnish:latest
|
||||
container_name: lista-zakupow-varnish
|
||||
depends_on:
|
||||
app:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "${APP_PORT:-8000}:80"
|
||||
volumes:
|
||||
- ../deploy/varnish/default.vcl:/etc/varnish/default.vcl:ro
|
||||
environment:
|
||||
- VARNISH_SIZE=256m
|
||||
networks:
|
||||
- lista-zakupow_network
|
||||
restart: unless-stopped
|
||||
|
||||
mysql:
|
||||
image: mysql:8
|
||||
container_name: lista-zakupow-mysql-db
|
||||
environment:
|
||||
MYSQL_DATABASE: ${DB_NAME}
|
||||
MYSQL_USER: ${DB_USER}
|
||||
MYSQL_PASSWORD: ${DB_PASSWORD}
|
||||
MYSQL_ROOT_PASSWORD: 89o38kUX5T4C
|
||||
volumes:
|
||||
- ../db/mysql:/var/lib/mysql
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- lista-zakupow_network
|
||||
profiles: ["mysql"]
|
||||
|
||||
pgsql:
|
||||
image: postgres:18
|
||||
container_name: lista-zakupow-pgsql
|
||||
environment:
|
||||
POSTGRES_DB: ${DB_NAME}
|
||||
POSTGRES_USER: ${DB_USER}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
PGDATA: /var/lib/postgresql
|
||||
volumes:
|
||||
- ../db/pgsql:/var/lib/postgresql
|
||||
networks:
|
||||
- lista-zakupow_network
|
||||
restart: unless-stopped
|
||||
profiles: ["pgsql"]
|
||||
|
||||
networks:
|
||||
lista-zakupow_network:
|
||||
driver: bridge
|
||||
21
docker/requirements-stable.txt
Normal file
21
docker/requirements-stable.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
bcrypt==5.0.0
|
||||
cryptography==46.0.5
|
||||
Flask==3.1.3
|
||||
Flask-Compress==1.23
|
||||
Flask-Login==0.6.3
|
||||
Flask-Session==0.8.0
|
||||
Flask-SocketIO==5.6.1
|
||||
Flask-SQLAlchemy==3.1.1
|
||||
flask-talisman==1.1.0
|
||||
gevent==25.9.1
|
||||
gevent-websocket==0.10.1
|
||||
opencv-python-headless>=4.12.0.88
|
||||
pdf2image==1.17.0
|
||||
pillow==12.1.1
|
||||
pillow_heif==1.3.0
|
||||
psutil==7.2.2
|
||||
psycopg2-binary==2.9.11
|
||||
PyMySQL==1.1.2
|
||||
pytesseract==0.3.13
|
||||
SQLAlchemy==2.0.48
|
||||
Werkzeug==3.1.6
|
||||
21
docker/requirements.txt
Normal file
21
docker/requirements.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
Flask
|
||||
Flask-SQLAlchemy
|
||||
Flask-Login
|
||||
Flask-SocketIO
|
||||
Flask-Compress
|
||||
#eventlet
|
||||
gevent-websocket
|
||||
Werkzeug
|
||||
Pillow
|
||||
psutil
|
||||
pillow-heif
|
||||
|
||||
pytesseract
|
||||
opencv-python-headless
|
||||
psycopg2-binary # pgsql
|
||||
pymysql # mysql
|
||||
cryptography # mysql8
|
||||
flask-talisman # nagłówki
|
||||
bcrypt
|
||||
Flask-Session
|
||||
pdf2image
|
||||
Reference in New Issue
Block a user