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

SECRET is mandatory and .env should not be inside container #2

Merged
merged 2 commits into from
Sep 9, 2024
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: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ data
.dev
.docker
.dockerignore
.env
.git
.gitignore
.prettierignore
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ docker pull pawelmalak/flame:2.0.0

#### Deployment

You have to generate a 64 random string

```sh
# run container
docker run -p 5005:5005 -v /path/to/data:/app/data -e PASSWORD=flame_password pawelmalak/flame
docker run -p 5005:5005 -v /path/to/data:/app/data -e PASSWORD=flame_password SECRET=yourRandom64String pawelmalak/flame
```

#### Building images
Expand Down Expand Up @@ -71,6 +73,7 @@ services:
environment:
- PASSWORD=flame_password
- PASSWORD_FILE=/run/secrets/password # optional but required for (1)
- SECRET=yourRandom64String
restart: unless-stopped

# optional but required for Docker secrets (1)
Expand Down
4 changes: 4 additions & 0 deletions utils/init/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ const initDockerSecrets = require('./initDockerSecrets');
const normalizeTheme = require('./normalizeTheme');

const initApp = async () => {
if (!process.env.SECRET) {
console.error('ERROR: SECRET key is missing in environment variables');
process.exit(1);
}
initDockerSecrets();
await initFiles();
await initConfig();
Expand Down