From c33197bd40ab313d758a5fc06d1db910cc7fcafc Mon Sep 17 00:00:00 2001 From: Erik K Anderson Date: Sun, 20 Aug 2023 19:53:20 -0500 Subject: [PATCH] add Dockerfile and docker-cmopose.yaml for deployment --- Dockerfile | 22 ++++++++++++++++++++++ docker-compose.yaml | 16 ++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..01bf505 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM python:3.10.3 + +# we want stdout +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 + +# add the path to pythonpath +ENV PYTHONPATH "${PYTHONPATH}:/app" + +# install uvloop for faster asyncio +RUN pip3.10 install uvloop + +# install the requirements +COPY ./requirements.txt /app/requirements.txt +RUN pip3.10 install -r /app/requirements.txt + +# copy over the source files +COPY ./ /app/ + +# start the bot +WORKDIR /app +CMD ["python3.10", "src/main.py"] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..7353785 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,16 @@ +version: "3.9" + +services: + bot2: + build: + context: ./ + dockerfile: ./Dockerfile + volumes: + - ./logs:/app/logs + networks: + - bot2-network + restart: + always + +networks: + bot2-network: