Skip to content

Commit

Permalink
Adds dockerfile and docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
hllustosa committed Aug 10, 2024
1 parent 484966c commit a8e9c73
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
docker_build:
@docker compose up --no-start slackbot-ai

docker_start_all: docker_build
@docker compose start slackbot-ai

docker_stop_all:
@docker compose stop
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
slackbot-ai:
container_name: slack-bot-ai
image: slackbot-ai:latest
build: .
ports:
- "7999:7999"
env_file: .env
tty: true
stdin_open: true
volumes:
- type: bind
source: .
target: /app/
29 changes: 29 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM python:3.10-slim AS base

ENV LANG C.UTF-8
ENV PYTHONUNBUFFERED 1

RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \
build-essential \
tzdata \
git \
libatlas-base-dev\
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
pip install --no-cache-dir poetry==1.4.0 setuptools && poetry config virtualenvs.create false


RUN pip install --upgrade pip && pip install --no-cache-dir poetry gunicorn uvicorn && poetry config virtualenvs.create false


FROM base AS install

WORKDIR /app
COPY pyproject.toml poetry.lock /app/
RUN poetry install --no-dev

FROM install AS runtime
COPY . /app/

ENTRYPOINT ["uvicorn", "project.api:app", "--host", "0.0.0.0", "--port", "7999", "--reload"]

0 comments on commit a8e9c73

Please sign in to comment.