Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions tails/python.tail.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ARG PYTHON_VERSION=3.14
FROM python:${PYTHON_VERSION}-alpine
COPY repo /bot
WORKDIR /bot

ARG MAIN_FILE=main.py
ENV MAIN_FILE=${MAIN_FILE}

ARG REQUIREMENTS_FILE=requirements.txt
ENV REQUIREMENTS_FILE=${REQUIREMENTS_FILE}

ARG VENV_ENABLED=false
ENV VENV_ENABLED=${VENV_ENABLED}

RUN if [ -f "${REQUIREMENTS_FILE}" ]; then \
if [ "$VENV_ENABLED" = "true" ]; then \
python -m venv /opt/venv; \
. /opt/venv/bin/activate; \
pip install --no-cache-dir -r "${REQUIREMENTS_FILE}"; \
else \
pip install --no-cache-dir -r "${REQUIREMENTS_FILE}"; \
fi \
fi

CMD if [ "$VENV_ENABLED" = "true" ]; then \
. /opt/venv/bin/activate && python ${MAIN_FILE}; \
else \
python ${MAIN_FILE}; \
fi
30 changes: 30 additions & 0 deletions tails/python.tail.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[tail]
name = "python"
display_name = "Python"
description = "Python Discord bot with pip support"
last_modified = 2025-10-27

[config.main_file]
type = "string"
default = "main.py"
arg = "MAIN_FILE"
description = "The main Python file to run when starting your bot."

[config.python_version]
type = "string"
default = "3.14"
arg = "PYTHON_VERSION"
description = "Version of Python to use."

[config.requirements_file]
type = "string"
default = "requirements.txt"
arg = "REQUIREMENTS_FILE"
description = "Path to requirements.txt file for dependencies."

[config.venv_enabled]
type = "string"
default = "false"
arg = "VENV_ENABLED"
description = "Whether to use Python virtual environment."
options = ["true", "false"]