2 Commits

Author SHA1 Message Date
899b88e907 Version 0.0.6 2025-02-27 22:08:17 +00:00
000f0932d8 Fix docker container 2025-02-27 22:07:32 +00:00
2 changed files with 20 additions and 31 deletions

View File

@@ -1,34 +1,21 @@
FROM python:3.9-alpine AS base
# Builder
FROM base AS builder
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \
PATH="$PATH:/runtime/bin" \
PYTHONPATH="$PYTHONPATH:/runtime/lib/python3.9/site-packages" \
# Versions:
POETRY_VERSION=2.1.1
# System deps:
RUN apk add build-base unzip wget python3-dev libffi-dev rust cargo openssl-dev
RUN pip install "poetry==$POETRY_VERSION" "poetry-plugin-export"
ENV POETRY_VERSION=2.1.1
RUN apk add build-base unzip wget python3-dev libffi-dev rust cargo openssl-dev && pip install "poetry==$POETRY_VERSION" && poetry self add poetry-plugin-bundle
WORKDIR /src
COPY poetry.lock pyproject.toml README.md /src/
COPY smsbot /src/smsbot
RUN poetry bundle venv /runtime
# Generate requirements and install *all* dependencies.
COPY pyproject.toml poetry.lock /src/
RUN poetry export --without-hashes --no-interaction --no-ansi -f requirements.txt -o requirements.txt
RUN pip install --prefix=/runtime --force-reinstall -r requirements.txt
# Final container
FROM base AS runtime
COPY --from=builder /runtime /usr/local
COPY . /app
WORKDIR /app
COPY --from=builder /runtime /runtime
ENV PATH=/runtime/bin:$PATH
EXPOSE 8000/tcp
CMD ["/usr/local/bin/smsbot"]
CMD ["smsbot"]

View File

@@ -1,11 +1,9 @@
[project]
name = "smsbot"
version = "0.0.5"
version = "0.0.6"
description = "A simple Telegram bot to receive SMS messages."
authors = [
{name = "Andrew Williams",email = "andy@tensixtyone.com"}
]
license = {text = "MIT"}
authors = [{ name = "Andrew Williams", email = "andy@tensixtyone.com" }]
license = { text = "MIT" }
readme = "README.md"
requires-python = ">=3.9,<3.10"
dependencies = [
@@ -13,12 +11,16 @@ dependencies = [
"waitress (>=3.0.2,<4.0.0)",
"twilio (>=9.4.6,<10.0.0)",
"python-telegram-bot (<20)",
"prometheus-client (>=0.21.1,<0.22.0)"
"prometheus-client (>=0.21.1,<0.22.0)",
]
[tool.poetry]
packages = [{ include = "smsbot" }]
[tool.poetry.scripts]
smsbot = "smsbot.cli:main"
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"