fix(dockerfile): add webui

This commit is contained in:
faycal 2025-03-14 22:27:57 +01:00
parent e5447280af
commit 3e1216eba2
2 changed files with 31 additions and 17 deletions

View File

@ -25,16 +25,30 @@ jobs:
- name: Configure Docker for Google Cloud
run: gcloud auth configure-docker
- name: Build Docker image
run: docker build -t gcr.io/${{ secrets.GCP_PROJECT_ID }}/moneyprinterturbo:$GITHUB_SHA .
- name: Build Docker image for webui
run: docker build -t gcr.io/${{ secrets.GCP_PROJECT_ID }}/moneyprinterturbo-webui:$GITHUB_SHA -f Dockerfile .
- name: Push Docker image
run: docker push gcr.io/${{ secrets.GCP_PROJECT_ID }}/moneyprinterturbo:$GITHUB_SHA
- name: Push Docker image for webui
run: docker push gcr.io/${{ secrets.GCP_PROJECT_ID }}/moneyprinterturbo-webui:$GITHUB_SHA
- name: Deploy to Cloud Run
- name: Build Docker image for api
run: docker build -t gcr.io/${{ secrets.GCP_PROJECT_ID }}/moneyprinterturbo-api:$GITHUB_SHA -f Dockerfile .
- name: Push Docker image for api
run: docker push gcr.io/${{ secrets.GCP_PROJECT_ID }}/moneyprinterturbo-api:$GITHUB_SHA
- name: Deploy webui to Cloud Run
run: |
gcloud run deploy moneyprinterturbo \
--image gcr.io/${{ secrets.GCP_PROJECT_ID }}/moneyprinterturbo:$GITHUB_SHA \
gcloud run deploy moneyprinterturbo-webui \
--image gcr.io/${{ secrets.GCP_PROJECT_ID }}/moneyprinterturbo-webui:$GITHUB_SHA \
--platform managed \
--region ${{ secrets.GCP_REGION }} \
--allow-unauthenticated
- name: Deploy api to Cloud Run
run: |
gcloud run deploy moneyprinterturbo-api \
--image gcr.io/${{ secrets.GCP_PROJECT_ID }}/moneyprinterturbo-api:$GITHUB_SHA \
--platform managed \
--region ${{ secrets.GCP_REGION }} \
--allow-unauthenticated

View File

@ -2,16 +2,16 @@ x-common-volumes: &common-volumes
- ./:/MoneyPrinterTurbo
services:
# webui:
# build:
# context: .
# dockerfile: Dockerfile
# container_name: "webui"
# ports:
# - "8501:8501"
# command: [ "streamlit", "run", "./webui/Main.py","--browser.serverAddress=127.0.0.1","--server.enableCORS=True","--browser.gatherUsageStats=False" ]
# volumes: *common-volumes
# restart: always
webui:
build:
context: .
dockerfile: Dockerfile
container_name: "webui"
ports:
- "8501:8501"
command: [ "streamlit", "run", "./webui/Main.py","--browser.serverAddress=127.0.0.1","--server.enableCORS=True","--browser.gatherUsageStats=False" ]
volumes: *common-volumes
restart: always
api:
build:
context: .