Skip to content

Commit

Permalink
Merge pull request #195 from microsoft/PSL-update-dockeryml-file
Browse files Browse the repository at this point in the history
ci: Docker image yml file updated for building conditionally
  • Loading branch information
Roopan-Microsoft authored Jan 27, 2025
2 parents 0ec2443 + 2546cc3 commit 56360f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ name: Build and Push Docker Image

on:
pull_request:
types: [closed]
types:
- opened
- ready_for_review
- reopened
- synchronize
branches:
- main
- dev
Expand All @@ -11,7 +15,6 @@ on:

jobs:
build-and-push:
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -58,3 +61,4 @@ jobs:
tags: |
${{ steps.registry.outputs.registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}
${{ steps.registry.outputs.registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}_${{ steps.date.outputs.date }}_${{ github.run_number }}
3 changes: 2 additions & 1 deletion WebApp.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ USER node
RUN npm ci
COPY --chown=node:node ./frontend/ ./frontend
WORKDIR /home/node/app/frontend
RUN npm install --save-dev @types/node @types/jest
RUN NODE_OPTIONS=--max_old_space_size=8192 npm run build

FROM python:3.11-alpine
Expand All @@ -27,4 +28,4 @@ COPY --from=frontend /home/node/app/static /usr/src/app/static/
WORKDIR /usr/src/app
EXPOSE 80

CMD ["gunicorn" , "-b", "0.0.0.0:80", "app:app"]
CMD ["gunicorn" , "-b", "0.0.0.0:80", "app:app"]

0 comments on commit 56360f2

Please sign in to comment.