Skip to content

Commit

Permalink
feat: flyio streamlit configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mehallhm committed May 29, 2024
1 parent 72bcae9 commit 81a4553
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim
FROM python:3.11-slim as dev

WORKDIR /apicode

Expand Down
12 changes: 8 additions & 4 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim
FROM python:3.11-slim AS dev

WORKDIR /appcode

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

Expand All @@ -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 .
4 changes: 2 additions & 2 deletions app/fly.toml
Original file line number Diff line number Diff line change
@@ -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.
#
Expand All @@ -17,6 +17,6 @@ primary_region = 'ams'
processes = ['app']

[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
memory_mb = 512
7 changes: 7 additions & 0 deletions app/src/App.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import streamlit as st

def App():
st.write("Hello")
'World'

App()
8 changes: 6 additions & 2 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
services:
app:
build: ./app
build:
context: ./app
target: dev
container_name: front-end
volumes:
["./app/src:/appcode"]
Expand All @@ -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"]
Expand Down

0 comments on commit 81a4553

Please sign in to comment.