Skip to content

Commit

Permalink
add docker
Browse files Browse the repository at this point in the history
  • Loading branch information
iskanred committed Apr 29, 2024
1 parent 65d29b7 commit dc4d9e9
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.github
.pytest_cache/
reports/
tests/
*.coverage
setenv.bash
Dockerfile*
Makefile
*.md
*.pdf
.*ignore
25 changes: 25 additions & 0 deletions Dockerfile-backend
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM python:3.11

# Configure Poetry
ENV POETRY_VERSION=1.7.1
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/.cache

# Install poetry separated from system interpreter
RUN python3 -m venv $POETRY_VENV \
&& $POETRY_VENV/bin/pip install -U pip setuptools \
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION}

# Add `poetry` to PATH
ENV PATH="${PATH}:${POETRY_VENV}/bin"

WORKDIR /app

# Install dependencies
COPY poetry.lock pyproject.toml ./
RUN poetry install

# Run your app
COPY . /app
CMD [ "poetry", "run", "bin/main.py"]
25 changes: 25 additions & 0 deletions Dockerfile-frontend
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM python:3.11

# Configure Poetry
ENV POETRY_VERSION=1.7.1
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/.cache

# Install poetry separated from system interpreter
RUN python3 -m venv $POETRY_VENV \
&& $POETRY_VENV/bin/pip install -U pip setuptools \
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION}

# Add `poetry` to PATH
ENV PATH="${PATH}:${POETRY_VENV}/bin"

WORKDIR /app

# Install dependencies
COPY poetry.lock pyproject.toml ./
RUN poetry install

# Run your app
COPY . /app
CMD [ "poetry", "run", "streamlit", "run", "ui/app.py" ]
15 changes: 15 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "3.8"

services:
backend:
image: iskanred/jago_rebt_backend:1.0.0
container_name: backend
ports:
- "8001:8001"
volumes:
- "./data:/app/data"
frontend:
image: iskanred/jago_rebt_frontend:1.0.0
container_name: frontend
ports:
- "8501:8501"

0 comments on commit dc4d9e9

Please sign in to comment.