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

Docker secrets #295

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Docker secrets #295

wants to merge 2 commits into from

Conversation

opichon
Copy link

@opichon opichon commented May 9, 2021

Allow database password to be defined in a file via the DATABASE_PASSWORD_FILE environment variable.
This adds support for Docker secrets in a Docker swarm.

Typical use would be as follows (this assumes the 1database-password` secret has been created outside of the strapi stack):

#docker-compsoe.yml
version: "3"

secrets:
  database-password:
    external: true

services:
  strapi:
    container_name: strapi
    image: strapi/strapi
    environment:
      - NODE_ENV=production
      - DATABASE_CLIENT=postgres
      - DATABASE_HOST=db
      - DATABASE_PORT=5432
      - DATABASE_NAME=strapi
      - DATABASE_USERNAME=strapi
      - DATABASE_PASSWORD_FILE=/run/secrets/database-password
    ports:
      - 1337:1337
    volumes:
      - ./app:/srv/app
    secrets:
      - database-password
    depends_on:
      - db
    command: 'strapi start'

@strapi-cla
Copy link

strapi-cla commented May 9, 2021

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants