generated from geekiot/python-template
feature/docker - add first docker compose & docker image files #5
3 changed files with 62 additions and 0 deletions
34
.dockerignore
Normal file
34
.dockerignore
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Git
|
||||
.git
|
||||
.gitignore
|
||||
LICENSE
|
||||
*.md
|
||||
|
||||
# Docker
|
||||
docker/
|
||||
.dockerignore
|
||||
|
||||
# Nix stuff
|
||||
flake.*
|
||||
|
||||
# Virtual environment
|
||||
.venv/
|
||||
venv/
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Logs
|
||||
logs/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# Ruff formatter
|
||||
.ruff_cache/
|
||||
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