Skip to content

Commit 48b9158

Browse files
committed
Docker secrets integration
1 parent d1d32cd commit 48b9158

File tree

10 files changed

+21753
-111
lines changed

10 files changed

+21753
-111
lines changed

.docker/Dockerfile.multiarch

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /app
44

55
COPY package*.json ./
66

7-
RUN apk --no-cache --virtual build-dependencies add python make g++ \
7+
RUN apk --no-cache --virtual build-dependencies add python python3 make g++ \
88
&& npm install --production
99

1010
COPY . .

.docker/docker-compose.yml

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
version: "3"
2-
3-
secrets:
4-
password:
5-
file: ./secrets/password
1+
version: '3.6'
62

73
services:
84
flame:
95
image: pawelmalak/flame
106
container_name: flame
117
volumes:
12-
- /path/to/data:/app/data
8+
- /path/to/host/data:/app/data
9+
# - /var/run/docker.sock:/var/run/docker.sock # optional but required for Docker integration
1310
ports:
1411
- 5005:5005
15-
secrets:
16-
- password
12+
# secrets:
13+
# - password # optional but required for (1)
1714
environment:
18-
- PASSWORD_FILE=/run/secrets/password
15+
- PASSWORD=flame_password
16+
# - PASSWORD_FILE=/run/secrets/password # optional but required for (1)
1917
restart: unless-stopped
18+
19+
# optional but required for Docker secrets (1)
20+
# secrets:
21+
# password:
22+
# file: /path/to/secrets/password

.docker/secrets/password

-1
This file was deleted.

.prettierignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
*.md
1+
*.md
2+
docker-compose.yml

README.md

+24-5
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,43 @@ docker buildx build \
5555
#### Docker-Compose
5656

5757
```yaml
58-
version: '2.1'
58+
version: '3.6'
59+
5960
services:
6061
flame:
61-
image: pawelmalak/flame:latest
62+
image: pawelmalak/flame
6263
container_name: flame
6364
volumes:
64-
- <host_dir>:/app/data
65-
- /var/run/docker.sock:/var/run/docker.sock # optional but required for Docker integration feature
65+
- /path/to/host/data:/app/data
66+
- /var/run/docker.sock:/var/run/docker.sock # optional but required for Docker integration
6667
ports:
6768
- 5005:5005
69+
secrets:
70+
- password # optional but required for (1)
6871
environment:
6972
- PASSWORD=flame_password
73+
- PASSWORD_FILE=/run/secrets/password # optional but required for (1)
7074
restart: unless-stopped
75+
76+
# optional but required for Docker secrets (1)
77+
secrets:
78+
password:
79+
file: /path/to/secrets/password
7180
```
7281
7382
##### Docker Secrets
7483
75-
All environment variables set can be overwritten by appending `_FILE` to the variable value.For example, you can use `PASSWORD_FILE` to pass through a docker secret instead of `PASSWORD`. If both `PASSWORD` and `PASSWORD_FILE` are set, the docker secret will take precedent. An example using docker secrets is available in [here](.docker/docker-compose.yml).
84+
All environment variables can be overwritten by appending `_FILE` to the variable value. For example, you can use `PASSWORD_FILE` to pass through a docker secret instead of `PASSWORD`. If both `PASSWORD` and `PASSWORD_FILE` are set, the docker secret will take precedent.
85+
86+
```bash
87+
# ./secrets/flame_password
88+
my_custom_secret_password_123
89+
90+
# ./docker-compose.yml
91+
secrets:
92+
password:
93+
file: ./secrets/flame_password
94+
```
7695

7796
#### Skaffold
7897

0 commit comments

Comments
 (0)