diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f80f30d..197264b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,4 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@master - - run: cd server && npm install && npx -y tsc \ No newline at end of file + - 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 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 28943fd..5dd3c82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ No newline at end of file diff --git a/server/src/index.ts b/server/src/index.ts index b04446e..1b52787 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -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(',');