diff --git a/InConstruction/Dockerfile b/InConstruction/Dockerfile new file mode 100644 index 0000000..bf26dd9 --- /dev/null +++ b/InConstruction/Dockerfile @@ -0,0 +1,27 @@ +# 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 . . + +# Default port used by the app +ENV FLET_PORT=8080 + +EXPOSE 8080 + +# Simple health endpoint is the root +HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD curl -fsS http://127.0.0.1:8080/ || exit 1 + +CMD ["python", "main.py"] \ No newline at end of file diff --git a/InConstruction/docker-compose.yml b/InConstruction/docker-compose.yml new file mode 100644 index 0000000..0506b40 --- /dev/null +++ b/InConstruction/docker-compose.yml @@ -0,0 +1,22 @@ +version: "3.9" + +networks: + reverse-proxy: + external: true + +services: + tainagustului: + build: . + container_name: tainagustului + restart: unless-stopped + environment: + TZ: "Europe/Bucharest" + FLET_PORT: "8080" + VIRTUAL_HOST: "tainagustului.ro,www.tainagustului.ro" + VIRTUAL_PORT: "8080" + LETSENCRYPT_HOST: "tainagustului.ro,www.tainagustului.ro" + LETSENCRYPT_EMAIL: "macamete.robert@gmail.com" + expose: + - "8080" + networks: + - reverse-proxy \ No newline at end of file diff --git a/InConstruction/main.py b/InConstruction/main.py index dfafa3f..ee4e5dd 100644 --- a/InConstruction/main.py +++ b/InConstruction/main.py @@ -23,6 +23,6 @@ ft.app( assets_dir="assets", upload_dir="uploads", view=ft.WEB_BROWSER, - port=5555, + port=8080, host="0.0.0.0" ) \ No newline at end of file diff --git a/InConstruction/requirements.txt b/InConstruction/requirements.txt new file mode 100644 index 0000000..38eee15 --- /dev/null +++ b/InConstruction/requirements.txt @@ -0,0 +1 @@ +flet==0.28.3 \ No newline at end of file