github action for docker
parent
633630807d
commit
68e4a5357c
|
@ -13,4 +13,11 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- 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
|
|
@ -34,4 +34,6 @@ RUN npm install
|
||||||
|
|
||||||
COPY ./server/src ./src
|
COPY ./server/src ./src
|
||||||
|
|
||||||
|
RUN CI=true cd /app && npm run start
|
||||||
|
|
||||||
COPY --from=build /app/build /app/public
|
COPY --from=build /app/build /app/public
|
|
@ -25,6 +25,10 @@ process.on('unhandledRejection', (reason, p) => {
|
||||||
console.error('Unhandled Rejection at: Promise', p, 'reason:', reason);
|
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 port = process.env.PORT ? parseInt(process.env.PORT, 10) : 3001;
|
||||||
const webappPort = process.env.WEBAPP_PORT ? parseInt(process.env.WEBAPP_PORT, 10) : 3000;
|
const webappPort = process.env.WEBAPP_PORT ? parseInt(process.env.WEBAPP_PORT, 10) : 3000;
|
||||||
const origins = (process.env.ALLOWED_ORIGINS || '').split(',');
|
const origins = (process.env.ALLOWED_ORIGINS || '').split(',');
|
||||||
|
|
Loading…
Reference in New Issue