diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..252054a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.13-slim +WORKDIR /app +COPY requirements.txt requirements.txt +RUN pip install --no-cache-dir -r requirements.txt +COPY . . +COPY run_waitress.py /run_waitress.py +RUN chmod +x /run_waitress.py +EXPOSE 8000 +ENTRYPOINT ["/run_waitress.py"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d2a99a2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +services: + hosts_app: + build: . + container_name: hosts_app + ports: + - "${APP_PORT:-5580}:5580" + healthcheck: + test: + [ + "CMD", + "python", + "-c", + "import urllib.request; import sys; sys.exit(0) if urllib.request.urlopen('http://localhost:8000/').getcode() == 200 else sys.exit(1)" + ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s + volumes: + - .:/app + - ./instance:/app/instance + restart: unless-stopped \ No newline at end of file