Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove always: restart configuration for MySQL from docker compose #301

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ services:
mysql:
image: mysql:8.0
command: '--default-authentication-plugin=mysql_native_password'
restart: always
healthcheck:
test: ['CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 --password="$$(cat /run/secrets/db-password)" --silent']
interval: 3s
Expand Down
17 changes: 14 additions & 3 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ storage/

## Dev environment

When using docker you have to bind the exposed ports to the wildcard address `0.0.0.0`, so you can access the application from the host machine.

The default API configuration uses `127.0.0.1`, so you have to change it to:

```toml
[http_api]
bind_address = "0.0.0.0:1212"
```

Otherwise the API will be only accessible from inside the container.

### With docker

Build and run locally:
Expand Down Expand Up @@ -78,7 +89,7 @@ CONTAINER ID IMAGE COMMAND CREATED STATU

And you should be able to use the application, for example making a request to the API:

<https://127.0.0.1:1212/api/stats?token=MyAccessToken>
<https://127.0.0.1:1212/api/v1/stats?token=MyAccessToken>

You can stop the containers with:

Expand Down Expand Up @@ -169,7 +180,7 @@ ssl_key_path = "./storage/ssl_certificates/localhost.key"

If you enable the SSL certificate for the API, for example, you can load the API with this URL:

<https://localhost:1212/api/stats?token=MyAccessToken>
<https://localhost:1212/api/v1/stats?token=MyAccessToken>

## Prod environment

Expand Down Expand Up @@ -232,7 +243,7 @@ CONTAINER ID IMAGE
intelligent-hawking registry.hub.docker.com/torrust/tracker:latest Running 4.236.213.57:6969->6969/udp, 4.236.213.57:1212->1212/tcp
```

After a while, you can use the tracker API `http://4.236.213.57:1212/api/stats?token=MyAccessToken` and the UDP tracker with your BitTorrent client using this tracker announce URL `udp://4.236.213.57:6969`.
After a while, you can use the tracker API `http://4.236.213.57:1212/api/v1/stats?token=MyAccessToken` and the UDP tracker with your BitTorrent client using this tracker announce URL `udp://4.236.213.57:6969`.

> NOTES:
>
Expand Down