mirror of
https://github.com/thomiceli/opengist.git
synced 2024-12-22 20:42:40 +00:00
Use Docker secrets (#340)
This commit is contained in:
parent
56b4fd45fd
commit
41dc2e451b
7 changed files with 30 additions and 10 deletions
|
@ -47,8 +47,6 @@ It can be used in a `docker-compose.yml` file :
|
||||||
3. Opengist is now running on port 6157, you can browse http://localhost:6157
|
3. Opengist is now running on port 6157, you can browse http://localhost:6157
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
opengist:
|
opengist:
|
||||||
image: ghcr.io/thomiceli/opengist:1.7
|
image: ghcr.io/thomiceli/opengist:1.7
|
||||||
|
|
|
@ -9,4 +9,10 @@ usermod -o -u "$UID" $USER
|
||||||
chown -R "$USER:$USER" /opengist
|
chown -R "$USER:$USER" /opengist
|
||||||
chown -R "$USER:$USER" /config.yml
|
chown -R "$USER:$USER" /config.yml
|
||||||
|
|
||||||
|
if [ -f "/run/secrets/opengist_secrets" ]; then
|
||||||
|
set -a
|
||||||
|
. /run/secrets/opengist_secrets
|
||||||
|
set +a
|
||||||
|
fi
|
||||||
|
|
||||||
exec su $USER -c "OG_OPENGIST_HOME=/opengist /app/opengist/opengist --config /config.yml"
|
exec su $USER -c "OG_OPENGIST_HOME=/opengist /app/opengist/opengist --config /config.yml"
|
||||||
|
|
|
@ -46,3 +46,27 @@ Usage via command line :
|
||||||
```shell
|
```shell
|
||||||
OG_LOG_LEVEL=info ./opengist
|
OG_LOG_LEVEL=info ./opengist
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Using Docker Compose secrets
|
||||||
|
|
||||||
|
You can use Docker Compose secrets to not expose sensitive information in your compose file, using a `.env` file.
|
||||||
|
|
||||||
|
```dotenv
|
||||||
|
# file secrets.env
|
||||||
|
OG_GITLAB_CLIENT_KEY=your_gitlab_client_key
|
||||||
|
OG_GITLAB_SECRET=your_gitlab_secret_key
|
||||||
|
```
|
||||||
|
|
||||||
|
And then use it in your compose file :
|
||||||
|
|
||||||
|
```yml
|
||||||
|
services:
|
||||||
|
opengist:
|
||||||
|
# ...
|
||||||
|
secrets:
|
||||||
|
- opengist_secrets
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
opengist_secrets:
|
||||||
|
file: ./secrets.env
|
||||||
|
```
|
|
@ -18,8 +18,6 @@ OG_DB_URI=mysql://root:passwd@localhost:3306/opengist_db
|
||||||
|
|
||||||
### Docker Compose
|
### Docker Compose
|
||||||
```yml
|
```yml
|
||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
opengist:
|
opengist:
|
||||||
image: ghcr.io/thomiceli/opengist:1
|
image: ghcr.io/thomiceli/opengist:1
|
||||||
|
|
|
@ -18,8 +18,6 @@ OG_DB_URI=postgres://postgres:passwd@localhost:5432/opengist_db
|
||||||
|
|
||||||
### Docker Compose
|
### Docker Compose
|
||||||
```yml
|
```yml
|
||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
opengist:
|
opengist:
|
||||||
image: ghcr.io/thomiceli/opengist:1
|
image: ghcr.io/thomiceli/opengist:1
|
||||||
|
|
|
@ -21,8 +21,6 @@ OG_SQLITE_JOURNAL_MODE=WAL
|
||||||
|
|
||||||
### Docker Compose
|
### Docker Compose
|
||||||
```yml
|
```yml
|
||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
opengist:
|
opengist:
|
||||||
image: ghcr.io/thomiceli/opengist:1
|
image: ghcr.io/thomiceli/opengist:1
|
||||||
|
|
|
@ -13,8 +13,6 @@ It can be used in a `docker-compose.yml` file :
|
||||||
3. Opengist is now running on port 6157, you can browse http://localhost:6157
|
3. Opengist is now running on port 6157, you can browse http://localhost:6157
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
opengist:
|
opengist:
|
||||||
image: ghcr.io/thomiceli/opengist:1
|
image: ghcr.io/thomiceli/opengist:1
|
||||||
|
|
Loading…
Reference in a new issue