Skip to content

Commit

Permalink
github action for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
cogentapps committed Mar 14, 2023
1 parent 6336308 commit 68e4a53
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: cd server && npm install && npx -y tsc
- run: cd server && npm install && npx -y tsc
test-docker:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build containers
run: docker-compose -f "docker-compose.yml" build
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ RUN npm install

COPY ./server/src ./src

RUN CI=true cd /app && npm run start

COPY --from=build /app/build /app/public
4 changes: 4 additions & 0 deletions server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ process.on('unhandledRejection', (reason, p) => {
console.error('Unhandled Rejection at: Promise', p, 'reason:', reason);
});

if (process.env.CI) {
setTimeout(() => process.exit(), 10000);
}

const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 3001;
const webappPort = process.env.WEBAPP_PORT ? parseInt(process.env.WEBAPP_PORT, 10) : 3000;
const origins = (process.env.ALLOWED_ORIGINS || '').split(',');
Expand Down

0 comments on commit 68e4a53

Please sign in to comment.