summaryrefslogtreecommitdiffstats
path: root/dev
diff options
context:
space:
mode:
Diffstat (limited to 'dev')
-rw-r--r--dev/Dockerfile11
-rw-r--r--dev/bot/__main__.py3
2 files changed, 8 insertions, 6 deletions
diff --git a/dev/Dockerfile b/dev/Dockerfile
index 0b35724a..49d03ffd 100644
--- a/dev/Dockerfile
+++ b/dev/Dockerfile
@@ -1,16 +1,17 @@
-FROM --platform=linux/amd64 ghcr.io/chrislovering/python-poetry-base:3.10-slim
+ARG python_version=3.11
+FROM --platform=linux/amd64 ghcr.io/chrislovering/python-poetry-base:$python_version-slim
# Install project dependencies
WORKDIR /app
COPY pyproject.toml poetry.lock ./
-RUN poetry install --no-root
+RUN poetry install --no-root --only dev,main
# Copy the source code in last to optimize rebuilding the image
COPY . .
# Install again, this time with the root project
-RUN poetry install
+RUN poetry install --only-root
-ENTRYPOINT ["python"]
-CMD ["-m", "bot"]
+ENTRYPOINT ["poetry"]
+CMD ["run", "python", "-m", "bot"]
diff --git a/dev/bot/__main__.py b/dev/bot/__main__.py
index 1b1a551a..e28be36b 100644
--- a/dev/bot/__main__.py
+++ b/dev/bot/__main__.py
@@ -31,4 +31,5 @@ async def main() -> None:
async with bot:
await bot.start(os.getenv("BOT_TOKEN"))
-asyncio.run(main())
+if os.getenv("IN_CI", "").lower() != "true":
+ asyncio.run(main())