diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..3fcb7fd --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,20 @@ +FROM ghcr.io/astral-sh/uv:trixie-slim + +# Settings for UV +ENV UV_COMPILE_BYTECODE=1 +ENV UV_TOOL_BIN_DIR=/usr/local/bin + +# Copy base project files +COPY . /urfu-daddy + +# Set working dir +WORKDIR /urfu-daddy + +# Run UV commands +RUN uv sync --locked --no-install-project --no-dev + +# Add uv installed tools to path +ENV PATH="/urfu-daddy/.venv/bin:$PATH" + +# Clear entrypoint +ENTRYPOINT [] diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml new file mode 100644 index 0000000..1c101f8 --- /dev/null +++ b/docker/docker-compose.yaml @@ -0,0 +1,8 @@ +services: + bot: + container_name: urfu-daddy-bot + build: + context: .. + dockerfile: ./docker/Dockerfile + command: sh -c "uv run --active --script ./scripts/pybabel.py compile && uv run ./src/main.py" + restart: always