add docker files
This commit is contained in:
31
Dockerfile
Normal file
31
Dockerfile
Normal file
@@ -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"]
|
||||||
28
docker-compose.yml
Normal file
28
docker-compose.yml
Normal file
@@ -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
|
||||||
2
main.py
2
main.py
@@ -22,4 +22,4 @@ def main(page: ft.Page):
|
|||||||
page.on_route_change = lambda _: route_change(page.route)
|
page.on_route_change = lambda _: route_change(page.route)
|
||||||
page.go('/')
|
page.go('/')
|
||||||
|
|
||||||
ft.app(target=main, assets_dir="assets", view=ft.WEB_BROWSER, port='8550')
|
ft.app(target=main, assets_dir="assets", view=ft.WEB_BROWSER, port=8550)
|
||||||
1
requirement.txt
Normal file
1
requirement.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
flet==0.28.3
|
||||||
Reference in New Issue
Block a user