Skip to content

Commit

Permalink
chore: add Dockerfile test
Browse files Browse the repository at this point in the history
  • Loading branch information
solufa committed Jun 7, 2024
1 parent c385f91 commit 95b6816
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
6 changes: 3 additions & 3 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 95b6816

Please sign in to comment.