diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fda5af5..1a037d5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,15 +19,15 @@ jobs: groups whoami docker ps - + - name: Build Docker Image run: | docker build -t streamlit-app \ - --build-arg OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} \ - --build-arg WEATHER_API_KEY=${{ secrets.WEATHER_API_KEY }} \ - --build-arg SERPER_API_KEY=${{ secrets.SERPER_API_KEY }} \ - --build-arg AMADEUS_API_KEY=${{ secrets.AMADEUS_API_KEY }} \ - --build-arg AMADEUS_API_SECRET=${{ secrets.AMADEUS_API_SECRET }} . + --build-arg OPENAI_API_KEY="${{ secrets.OPENAI_API_KEY }}" \ + --build-arg WEATHER_API_KEY="${{ secrets.WEATHER_API_KEY }}" \ + --build-arg SERPER_API_KEY="${{ secrets.SERPER_API_KEY }}" \ + --build-arg AMADEUS_API_KEY="${{ secrets.AMADEUS_API_KEY }}" \ + --build-arg AMADEUS_API_SECRET="${{ secrets.AMADEUS_API_SECRET }}" . - name: Authenticate to AWS ECR uses: aws-actions/configure-aws-credentials@v4 diff --git a/Dockerfile b/Dockerfile index a6869a8..f6ab889 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,15 +7,22 @@ COPY . . # Install dependencies RUN pip install --no-cache-dir -r requirements.txt -# Load environment variables from GitHub secrets -ENV OPENAI_API_KEY=$OPENAI_API_KEY -ENV WEATHER_API_KEY=$WEATHER_API_KEY -ENV SERPER_API_KEY=$SERPER_API_KEY -ENV AMADEUS_API_KEY=$AMADEUS_API_KEY -ENV AMADEUS_API_SECRET=$AMADEUS_API_SECRET +# Define build arguments +ARG OPENAI_API_KEY +ARG WEATHER_API_KEY +ARG SERPER_API_KEY +ARG AMADEUS_API_KEY +ARG AMADEUS_API_SECRET + +# Set environment variables from build arguments +ENV OPENAI_API_KEY=${OPENAI_API_KEY} +ENV WEATHER_API_KEY=${WEATHER_API_KEY} +ENV SERPER_API_KEY=${SERPER_API_KEY} +ENV AMADEUS_API_KEY=${AMADEUS_API_KEY} +ENV AMADEUS_API_SECRET=${AMADEUS_API_SECRET} # Expose the port Streamlit uses EXPOSE 8501 # Run Streamlit app -CMD ["streamlit", "run", "deployment/app.py", "--server.port=8501", "--server.address=0.0.0.0"] +CMD ["streamlit", "run", "deployment/app.py", "--server.port=8501", "--server.address=0.0.0.0"] \ No newline at end of file