Add docker files

This commit is contained in:
kbe
2025-07-20 16:38:14 +02:00
parent 5dcc2a89ae
commit 5fd084702f
4 changed files with 56 additions and 7 deletions

6
.dockerignore Normal file
View File

@@ -0,0 +1,6 @@
# Exclude Python virtual environment
.env
venv/
env/
__pycache__/
*.py[cod]

8
.gitignore vendored
View File

@@ -177,10 +177,4 @@ poetry.toml
# LSP config files # LSP config files
pyrightconfig.json pyrightconfig.json
# End of https://www.toptal.com/developers/gitignore/api/python # End of https://www.toptal.com/developers/gitignore/api/python
# Docker
docker-compose.override.yml
docker-compose.yml
Dockerfile
.dockerignore

29
Dockerfile Normal file
View File

@@ -0,0 +1,29 @@
# Use the official Python image from Docker Hub
FROM python:3.11-slim
# Set the working directory
WORKDIR /app
# Set environment variables using the ARG values
ENV CROSSFIT_USERNAME=${CROSSFIT_USERNAME}
ENV CROSSFIT_PASSWORD=${CROSSFIT_PASSWORD}
ENV EMAIL_FROM=${EMAIL_FROM}
ENV EMAIL_TO=${EMAIL_TO}
ENV EMAIL_PASSWORD=${EMAIL_PASSWORD}
ENV TELEGRAM_TOKEN=${TELEGRAM_TOKEN}
ENV TELEGRAM_CHAT_ID=${TELEGRAM_CHAT_ID}
# Copy the requirements file
COPY requirements.txt .
# Install the required dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code
COPY . .
# Create log directory
RUN mkdir -p log
# Set the entry point to run the main script
ENTRYPOINT ["python", "book_crossfit.py"]

20
docker-compose.yml Normal file
View File

@@ -0,0 +1,20 @@
version: '3.8'
services:
crossfit-booker:
build:
context: .
dockerfile: Dockerfile
container_name: crossfit-booker
environment:
- CROSSFIT_USERNAME=${CROSSFIT_USERNAME}
- CROSSFIT_PASSWORD=${CROSSFIT_PASSWORD}
- SMTP_SERVER=${SMTP_SERVER}
- EMAIL_FROM=${EMAIL_FROM}
- EMAIL_TO=${EMAIL_TO}
- EMAIL_PASSWORD=${EMAIL_PASSWORD}
- TELEGRAM_TOKEN=${TELEGRAM_TOKEN}
- TELEGRAM_CHAT_ID=${TELEGRAM_CHAT_ID}
volumes:
- ./log:/app/log
restart: unless-stopped