diff --git a/api/Dockerfile b/api/Dockerfile index 7abbdda..2182950 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim +FROM python:3.11-slim as dev WORKDIR /apicode diff --git a/app/Dockerfile b/app/Dockerfile index 6eb11bf..a7ff82d 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim +FROM python:3.11-slim AS dev WORKDIR /appcode @@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y \ # RUN mkdir /requirements # COPY ./src/requirements.txt /requirements/requirements.txt -COPY ./src/requirements.txt . +COPY ./requirements.txt . RUN pip3 install -r requirements.txt @@ -22,6 +22,10 @@ EXPOSE 8501 # HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health -# ENTRYPOINT ["streamlit", "run", "src/Home.py", "--server.port=8501", "--server.address=0.0.0.0"] +# ENTRYPOINT ["streamlit", "run", "src/App.py", "--server.port=8501", "--server.address=0.0.0.0"] -CMD ["streamlit", "run", "Home.py", "--server.port=8501", "--server.address=0.0.0.0"] +CMD ["streamlit", "run", "App.py", "--server.port=8501", "--server.address=0.0.0.0"] + +FROM dev as prod + +COPY ./src . diff --git a/app/fly.toml b/app/fly.toml index 84a8517..e4446ce 100644 --- a/app/fly.toml +++ b/app/fly.toml @@ -1,4 +1,4 @@ -# fly.toml app configuration file generated for streamlit-app on 2024-02-08T04:59:06-05:00 +# fly.toml app configuration file generated for green-griddle-streamlit on 2024-05-29T10:28:04+02:00 # # See https://fly.io/docs/reference/configuration/ for information about how to use this file. # @@ -17,6 +17,6 @@ primary_region = 'ams' processes = ['app'] [[vm]] + memory = '1gb' cpu_kind = 'shared' cpus = 1 - memory_mb = 512 diff --git a/app/src/App.py b/app/src/App.py new file mode 100644 index 0000000..7a8b8ee --- /dev/null +++ b/app/src/App.py @@ -0,0 +1,7 @@ +import streamlit as st + +def App(): + st.write("Hello") + 'World' + +App() diff --git a/compose.yaml b/compose.yaml index e013d19..2984070 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,6 +1,8 @@ services: app: - build: ./app + build: + context: ./app + target: dev container_name: front-end volumes: ["./app/src:/appcode"] @@ -9,7 +11,9 @@ services: - 8501:8501 api: - build: ./api + build: + context: ./api + target: dev container_name: web-api hostname: web-api volumes: ["./api:/apicode"]