From fdb41770122dbc2d487c6804f98a077c9e5799bf Mon Sep 17 00:00:00 2001 From: Marius Robert Macamete Date: Mon, 24 Nov 2025 13:36:32 +0200 Subject: [PATCH] add docker files --- Dockerfile | 31 +++++++++++++++++++++++++++++++ docker-compose.yml | 28 ++++++++++++++++++++++++++++ main.py | 2 +- requirement.txt | 1 + 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 requirement.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fc8f324 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +# Slim Python image +FROM python:3.12-slim + +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 + +# System deps for pip & curl (for healthcheck) +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential curl \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +# Ensure persistent folders exist +RUN mkdir -p /app/instance /app/assets + +# Default port +ENV FLET_PORT=8550 + +EXPOSE 8550 + +# Health check +HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD curl -fsS http://127.0.0.1:8550/ || exit 1 + +# Run entrypoint to create superuser and start the app +ENTRYPOINT ["sh", "-c", "python main.py"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9f90615 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,28 @@ +version: "3.9" + +networks: + reverse-proxy_default: + external: true + +volumes: + aquila_instance: + aquila_assets: + +services: + aquilasoft: + build: . + container_name: aquilasoft + restart: unless-stopped + environment: + TZ: "Europe/Bucharest" + VIRTUAL_HOST: "aquilasoft.eu,www.aquilasoft.eu" + VIRTUAL_PORT: "8550" + LETSENCRYPT_HOST: "aquilasoft.eu,www.aquilasoft.eu" + LETSENCRYPT_EMAIL: "macamete.robert@gmail.com" + expose: + - "8550" + volumes: + - aquila_instance:/app/instance + - aquila_assets:/app/assets + networks: + - reverse-proxy_default \ No newline at end of file diff --git a/main.py b/main.py index d4677fe..3e3961b 100644 --- a/main.py +++ b/main.py @@ -22,4 +22,4 @@ def main(page: ft.Page): page.on_route_change = lambda _: route_change(page.route) page.go('/') -ft.app(target=main, assets_dir="assets", view=ft.WEB_BROWSER, port='8550') \ No newline at end of file +ft.app(target=main, assets_dir="assets", view=ft.WEB_BROWSER, port=8550) \ No newline at end of file diff --git a/requirement.txt b/requirement.txt new file mode 100644 index 0000000..38eee15 --- /dev/null +++ b/requirement.txt @@ -0,0 +1 @@ +flet==0.28.3 \ No newline at end of file