refractoring

This commit is contained in:
2025-03-19 13:45:50 +01:00
parent 27f1270a2e
commit 3c85bc387d
3 changed files with 50 additions and 19 deletions

18
Dockerfile Normal file
View File

@@ -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"]

View File

@@ -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"]

32
docker-compose.yml Normal file
View File

@@ -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