generated from geekiot/python-template
feature/docker - add first docker compose & docker image files #5
2 changed files with 28 additions and 0 deletions
20
docker/Dockerfile
Normal file
20
docker/Dockerfile
Normal file
|
|
@ -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 []
|
||||||
8
docker/docker-compose.yaml
Normal file
8
docker/docker-compose.yaml
Normal file
|
|
@ -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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue