Merge pull request 'Add docker files' (#2) from develop into main
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Exclude Python virtual environment
|
||||||
|
.env
|
||||||
|
venv/
|
||||||
|
env/
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -178,9 +178,3 @@ poetry.toml
|
|||||||
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
29
Dockerfile
Normal 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
20
docker-compose.yml
Normal 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
|
||||||
Reference in New Issue
Block a user