diff --git a/.github/workflows/deploy_app.yml b/.github/workflows/deploy_app.yml index a331e68..e2d1cbc 100644 --- a/.github/workflows/deploy_app.yml +++ b/.github/workflows/deploy_app.yml @@ -72,6 +72,8 @@ jobs: - run: | touch .dockerignore echo "server/**" >> .dockerignore + touch .gcloudignore + echo "server/**" >> .gcloudignore - id: deploy uses: google-github-actions/deploy-cloudrun@v2 diff --git a/.github/workflows/deploy_server.yml b/.github/workflows/deploy_server.yml index 6f7ae56..154bc41 100644 --- a/.github/workflows/deploy_server.yml +++ b/.github/workflows/deploy_server.yml @@ -77,6 +77,8 @@ jobs: - run: | touch .dockerignore echo "app/**" >> .dockerignore + touch .gcloudignore + echo "app/**" >> .gcloudignore - name: Deploy to Cloud Run id: deploy diff --git a/app/Dockerfile b/app/Dockerfile index e6672fe..d899be2 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -18,6 +18,7 @@ RUN apt-get -yqq update && apt-get -yqq install \ && rm -rf /var/lib/apt/lists/* COPY . ./ +# RUN rm -rf ./server # Install production dependencies. RUN pip install --no-cache-dir -r requirements.txt @@ -26,4 +27,4 @@ ENV HOST '0.0.0.0' EXPOSE $PORT HEALTHCHECK CMD curl --fail http://$HOST:$PORT/_stcore/health -CMD exec streamlit run index.py --server.port=$PORT --server.address=$HOST +CMD exec streamlit run app/index.py --server.port=$PORT --server.address=$HOST diff --git a/server/Dockerfile b/server/Dockerfile index b437199..5915c2f 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -2,6 +2,7 @@ # https://hub.docker.com/_/python FROM python:3.12-slim +# Allow statements and log messages to immediately appear in the Knative logs ENV PYTHONUNBUFFERED True ENV PYTHONDONTWRITEBYTECODE 1 @@ -17,6 +18,7 @@ RUN apt-get -yqq update && apt-get -yqq install \ && rm -rf /var/lib/apt/lists/* COPY . ./ +# RUN rm -rf ./app # Install production dependencies. RUN pip install --no-cache-dir -r requirements.txt @@ -28,4 +30,4 @@ ENV TIMEOUT 0 EXPOSE 8080 -CMD exec gunicorn -k uvicorn.workers.UvicornWorker -b :$PORT -w $WORKER --threads $THREADS -t $TIMEOUT --preload src.main:app +CMD exec gunicorn -k uvicorn.workers.UvicornWorker -b :$PORT -w $WORKER --threads $THREADS -t $TIMEOUT --preload server.src.main:app