Skip to content

Commit

Permalink
Use Docker secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
thomiceli committed Sep 27, 2024
1 parent 56b4fd4 commit eaa3cff
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 10 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```yml
version: "3"

services:
opengist:
image: ghcr.io/thomiceli/opengist:1.7
Expand Down
6 changes: 6 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@ usermod -o -u "$UID" $USER
chown -R "$USER:$USER" /opengist
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"
24 changes: 24 additions & 0 deletions docs/configuration/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,27 @@ Usage via command line :
```shell
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
```
2 changes: 0 additions & 2 deletions docs/configuration/databases/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ OG_DB_URI=mysql://root:passwd@localhost:3306/opengist_db

### Docker Compose
```yml
version: "3"

services:
opengist:
image: ghcr.io/thomiceli/opengist:1
Expand Down
2 changes: 0 additions & 2 deletions docs/configuration/databases/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ OG_DB_URI=postgres://postgres:passwd@localhost:5432/opengist_db

### Docker Compose
```yml
version: "3"

services:
opengist:
image: ghcr.io/thomiceli/opengist:1
Expand Down
2 changes: 0 additions & 2 deletions docs/configuration/databases/sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ OG_SQLITE_JOURNAL_MODE=WAL

### Docker Compose
```yml
version: "3"

services:
opengist:
image: ghcr.io/thomiceli/opengist:1
Expand Down
2 changes: 0 additions & 2 deletions docs/installation/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```yml
version: "3"

services:
opengist:
image: ghcr.io/thomiceli/opengist:1
Expand Down

0 comments on commit eaa3cff

Please sign in to comment.