Merge pull request #2588 from dunn/docker-compose-env

docker-compose: store default db passwords in .env.docker
This commit is contained in:
daniel 2021-04-06 21:38:14 -06:00 committed by GitHub
commit 56458c1f40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 18 deletions

View file

@ -56,11 +56,16 @@ MAIL_ENCRYPTION=null
## Databases (MySQL)
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=pixelfed_prod
DB_HOST=db
DB_PASSWORD=pixelfed_db_pass
DB_PORT=3306
DB_DATABASE=pixelfed
DB_USERNAME=pixelfed
DB_PASSWORD=pixelfed
# pass the same values to the db itself
MYSQL_DATABASE=pixelfed_prod
MYSQL_PASSWORD=pixelfed_db_pass
MYSQL_RANDOM_ROOT_PASSWORD=true
MYSQL_USER=pixelfed
## Databases (Postgres)
#DB_CONNECTION=pgsql
@ -74,7 +79,7 @@ DB_PASSWORD=pixelfed
REDIS_CLIENT=phpredis
REDIS_SCHEME=tcp
REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PASSWORD=redis_password
REDIS_PORT=6379
REDIS_DATABASE=0

View file

@ -11,7 +11,6 @@ version: '3'
# if the volumes are properly shared between cluster members.
services:
## App and Worker
app:
# Comment to use dockerhub image
@ -21,16 +20,15 @@ services:
image: pixelfed
restart: unless-stopped
env_file:
- ./.env.docker
- .env.docker
volumes:
- "app-storage:/var/www/storage"
- "app-bootstrap:/var/www/bootstrap"
- "./.env.docker:/var/www/.env"
- app-storage:/var/www/storage
- app-bootstrap:/var/www/bootstrap
networks:
- external
- internal
ports:
- "8080:80"
- "8080:80"
depends_on:
- db
- redis
@ -42,10 +40,10 @@ services:
image: pixelfed
restart: unless-stopped
env_file:
- ./.env.docker
- .env.docker
volumes:
- "app-storage:/var/www/storage"
- "app-bootstrap:/var/www/bootstrap"
- app-storage:/var/www/storage
- app-bootstrap:/var/www/bootstrap
networks:
- external
- internal
@ -61,17 +59,16 @@ services:
networks:
- internal
command: --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_DATABASE=pixelfed
- MYSQL_USER=${DB_USERNAME}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_RANDOM_ROOT_PASSWORD=true
env_file:
- .env.docker
volumes:
- "db-data:/var/lib/mysql"
redis:
image: redis:5-alpine
restart: unless-stopped
env_file:
- .env.docker
volumes:
- "redis-data:/data"
networks: