Skip to content

Instantly share code, notes, and snippets.

@jwill9999
Last active October 25, 2018 21:35
Show Gist options
  • Save jwill9999/6dcc87e200925b557e9077391f70d707 to your computer and use it in GitHub Desktop.
Save jwill9999/6dcc87e200925b557e9077391f70d707 to your computer and use it in GitHub Desktop.
docker dev environment files

Instructions

In development you must use a file based secret however in production this can be set to use the

docker secret create [OPTIONS] SECRET [file|-]

In production swarm / stack docker-compose file below.

version: "3.1"
services:
psql:
image: postgres
secrets:
- psql_user
- psql_password
environment:
POSTGRES_PASSWORD_FILE: /run/secrets/psql_password
POSTGRES_USER_FILE: /run/secrets/psql_user
secrets:
psql_user:
file: ./psql_user.txt
psql_password:
file: ./psql_password.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment