Skip to content

Commit

Permalink
build: setup docker config
Browse files Browse the repository at this point in the history
  • Loading branch information
deadaf committed Nov 28, 2023
1 parent c9ddb6c commit 3f110cb
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 14 deletions.
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM python:3.11-buster as builder

RUN pip install poetry==1.5.1

ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache

WORKDIR /app

COPY pyproject.toml poetry.lock ./
RUN touch README.md

RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root

FROM python:3.11-slim-buster as runtime

ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"

COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}

COPY src src

ENTRYPOINT ["python","src/bot.py"]
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "3.8"

services:
quotient-bot:
build:
context: .
ports:
- "8888:8888"
restart: always

environment:
- PYTHONUNBUFFERED=1 # Ensure Python output is not buffered

volumes:
- ./logs:/app/logs # Mount a volume for logs
14 changes: 0 additions & 14 deletions pm2.json

This file was deleted.

0 comments on commit 3f110cb

Please sign in to comment.