From b1fd46a1b0d6d2156bf1120d5602f94c781d1d53 Mon Sep 17 00:00:00 2001 From: Joshue Abance Date: Fri, 3 Jan 2025 21:28:12 +0800 Subject: [PATCH] deploy: setup docker and compose files --- Dockerfile | 14 ++++++++++++++ docker-compose.yml | 7 +++++++ dokploy.docker-compose.yml | 14 ++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 dokploy.docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bd0ff84 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM python:3.12-slim + +# Install uv. +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ + +# Copy the application into the container. +COPY . /app + +# Install the application dependencies. +WORKDIR /app +RUN uv sync --frozen --no-cache + +# Run the application. +CMD ["/app/.venv/bin/fastapi", "run", "app/main.py", "--port", "8000", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d97172e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +services: + app: + build: + context: . + dockerfile: Dockerfile + ports: + - 8000:8000 diff --git a/dokploy.docker-compose.yml b/dokploy.docker-compose.yml new file mode 100644 index 0000000..8369663 --- /dev/null +++ b/dokploy.docker-compose.yml @@ -0,0 +1,14 @@ +services: + app: + build: + context: . + dockerfile: Dockerfile + restart: always + expose: + - 8000 + networks: + - dokploy-network + +networks: + dokploy-network: + external: true