Skip to content

Commit

Permalink
chore(docs): add basic info about Docker Compose
Browse files Browse the repository at this point in the history
test: test Docker service
  • Loading branch information
greatislander committed Jun 27, 2024
1 parent 16ea671 commit a14a5cd
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Run Docker test

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
docker-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Run Docker integration tests
run: |
curl --location --remote-name https://github.com/Orange-OpenSource/hurl/releases/download/4.0.0/hurl_4.0.0_amd64.deb
sudo dpkg -i hurl_4.0.0_amd64.deb
bin/integration.sh http://localhost:3000/auth
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The server will be available at <http://localhost:3000>.

### Deployment using Docker Compose

TODO.
The project contains an example [Docker Compose file](docker-compose.yml) which can be used as a basis for deploying the application with Docker Compose. For more information on how to modify the file for this purpose, see ["Use Compose in production"](https://docs.docker.com/compose/production/).

## License

Expand Down
17 changes: 17 additions & 0 deletions bin/integration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
set -eu

wait_for_url () {
echo "Testing $1..."
printf 'GET %s\nHTTP 200' "$1" | hurl --retry "$2" > /dev/null;
return 0
}

echo "Starting container..."
docker compose up --detach --build

echo "Waiting for server to be ready..."
wait_for_url "$1" 60

echo "Stopping container..."
docker compose down
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
idrc-cms-authenticator:
build: .
container_name: "auth-incd-ca"
env_file: .env.test
ports:
- "3000:3000"

0 comments on commit a14a5cd

Please sign in to comment.