github action for docker

main
Cogent Apps 2023-03-14 21:11:18 +00:00
parent 633630807d
commit 68e4a5357c
3 changed files with 14 additions and 1 deletions

View File

@ -14,3 +14,10 @@ jobs:
steps:
- uses: actions/checkout@master
- 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

View File

@ -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

View File

@ -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(',');