diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..95c565c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.12-slim + +WORKDIR /app + +# Copy the entire project +COPY . . + +# Install the package and dependencies +RUN --mount=type=cache,target=/root/.cache pip install --no-cache-dir . + +# Expose Streamlit port +EXPOSE 8501 + +# Set environment variables +ENV PYTHONUNBUFFERED=1 + +# Run the Streamlit app +CMD ["auracaster-webui"] diff --git a/Dockerfile.ui b/Dockerfile.ui deleted file mode 100644 index 44fe5be..0000000 --- a/Dockerfile.ui +++ /dev/null @@ -1,19 +0,0 @@ -FROM python:3.12-slim - -WORKDIR /app - -# Copy only necessary files and directories -COPY src/auracaster_webui/ ./src/auracaster_webui/ -COPY src/api_client/ ./src/api_client/ - -# Install the package -RUN pip install --no-cache-dir . - -# Expose Streamlit port -EXPOSE 8501 - -# Set environment variables -ENV PYTHONUNBUFFERED=1 - -# Run the Streamlit app -CMD ["auracaster-webui"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9039666 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3.8' + +services: + webui: + build: + context: . + dockerfile: Dockerfile + ports: + - "8501:8501" + volumes: + - .:/app + environment: + - PYTHONUNBUFFERED=1 + # Change this URL if the translator service is running on a different host + - TRANSLATOR_API_URL=http://translator:7999 + restart: unless-stopped + networks: + - webui-network + - translator-network + # Uncomment the below if you want the webui to depend on the translator + # when running the two services together + # depends_on: + # - translator + +networks: + webui-network: + name: webui-network + driver: bridge + translator-network: + name: translator-network + driver: bridge + external: true