diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e7ac75e..53e1374 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,5 +37,12 @@ jobs: - run: npm run lint - run: npm run typecheck - run: cp server/.env.example server/.env - - run: docker compose up -d + - run: docker compose up -d -p magnito-test - run: npm test + + - run: docker build . -t magnito --build-arg VERSION=0.0.0 + - run: docker images + - run: docker run -d --name test --network magnito-test_default magnito + - run: count=0 && until [ "$(docker inspect --format='{{json .State.Health.Status}}' test)" == "\"healthy\"" ] || [ $count -eq 30 ]; do sleep 1; count=$((count + 1)); done && [ $count -ne 30 ] + - run: docker ps + - run: docker stop test diff --git a/Dockerfile b/Dockerfile index f0bf4fa..e07b5c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,7 @@ RUN npm run batch:writeVersion -- $VERSION RUN npm run build RUN apk --no-cache add curl -HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD curl -f $API_ORIGIN/health || exit 1 +HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD curl -f $API_ORIGIN/health && curl -f $CORS_ORIGIN || exit 1 EXPOSE 5000 5001 VOLUME ["/usr/src/app/data"] diff --git a/compose.yml b/compose.yml index 4f117f6..c8d93a6 100644 --- a/compose.yml +++ b/compose.yml @@ -2,9 +2,9 @@ services: inbucket: image: inbucket/inbucket:3.0.3 ports: - - '2500:2500' # SMTP - - '9000:9000' # web interface - - '1100:1100' # POP3 + - 2500:2500 # SMTP + - 9000:9000 # web interface + - 1100:1100 # POP3 volumes: - inbucket:/storage