feat: introduce Docker setup for app containerization

- Added Dockerfile and docker-compose.yml to facilitate the creation of a Docker image for the application, enabling containerization.
This commit is contained in:
Rajtilak Bhattacharjee 2023-11-13 21:20:34 +05:30
parent e6e4300c91
commit 49a00fd559
2 changed files with 30 additions and 0 deletions

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM python:3.10-slim-bullseye
ENV HOST=0.0.0.0
ENV LISTEN_PORT 8080
EXPOSE 8080
RUN apt-get update && apt-get install -y git
COPY ./requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
WORKDIR app/
COPY ./src /app/src
COPY ./.streamlit /app/.streamlit
CMD ["streamlit", "run", "src/main.py", "--server.port", "8080"]

10
docker-compose.yml Normal file
View File

@ -0,0 +1,10 @@
version: "3"
services:
keepyourmouthshut:
image: keepyourmouthshut:latest
build: ./app
command: streamlit run src/main.py --server.port 8080
volumes:
- ./src/:/app/src
ports:
- 8080:8080