Skip to content

Commit a7d3671

Browse files
authored
♻️ Simplify env files, merge to one .env (fastapi#151)
1 parent 894b0a5 commit a7d3671

File tree

9 files changed

+38
-36
lines changed

9 files changed

+38
-36
lines changed

scripts/discard-dev-files.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ git checkout \{\{cookiecutter.project_slug\}\}/README.md
66
git checkout \{\{cookiecutter.project_slug\}\}/.gitlab-ci.yml
77
git checkout \{\{cookiecutter.project_slug\}\}/cookiecutter-config-file.yml
88
git checkout \{\{cookiecutter.project_slug\}\}/docker-compose.deploy.networks.yml
9-
git checkout \{\{cookiecutter.project_slug\}\}/env-backend.env
10-
git checkout \{\{cookiecutter.project_slug\}\}/env-flower.env
119
git checkout \{\{cookiecutter.project_slug\}\}/.env
1210
git checkout \{\{cookiecutter.project_slug\}\}/frontend/.env
13-
git checkout \{\{cookiecutter.project_slug\}\}/env-pgadmin.env
14-
git checkout \{\{cookiecutter.project_slug\}\}/env-postgres.env
11+

{{cookiecutter.project_slug}}/.env

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,34 @@ TRAEFIK_PUBLIC_TAG={{cookiecutter.traefik_public_constraint_tag}}
1313
DOCKER_IMAGE_BACKEND={{cookiecutter.docker_image_backend}}
1414
DOCKER_IMAGE_CELERYWORKER={{cookiecutter.docker_image_celeryworker}}
1515
DOCKER_IMAGE_FRONTEND={{cookiecutter.docker_image_frontend}}
16+
17+
# Backend
18+
BACKEND_CORS_ORIGINS={{cookiecutter.backend_cors_origins}}
19+
PROJECT_NAME={{cookiecutter.project_name}}
20+
SECRET_KEY={{cookiecutter.secret_key}}
21+
FIRST_SUPERUSER={{cookiecutter.first_superuser}}
22+
FIRST_SUPERUSER_PASSWORD={{cookiecutter.first_superuser_password}}
23+
SMTP_TLS=True
24+
SMTP_PORT={{cookiecutter.smtp_port}}
25+
SMTP_HOST={{cookiecutter.smtp_host}}
26+
SMTP_USER={{cookiecutter.smtp_user}}
27+
SMTP_PASSWORD={{cookiecutter.smtp_password}}
28+
EMAILS_FROM_EMAIL={{cookiecutter.smtp_emails_from_email}}
29+
30+
USERS_OPEN_REGISTRATION=False
31+
32+
SENTRY_DSN={{cookiecutter.sentry_dsn}}
33+
34+
# Flower
35+
FLOWER_BASIC_AUTH={{cookiecutter.flower_auth}}
36+
37+
# Postgres
38+
POSTGRES_SERVER=db
39+
POSTGRES_USER=postgres
40+
POSTGRES_PASSWORD={{cookiecutter.postgres_password}}
41+
POSTGRES_DB=app
42+
43+
# PgAdmin
44+
PGADMIN_LISTEN_PORT=5050
45+
PGADMIN_DEFAULT_EMAIL={{cookiecutter.pgadmin_default_user}}
46+
PGADMIN_DEFAULT_PASSWORD={{cookiecutter.pgadmin_default_user_password}}

{{cookiecutter.project_slug}}/docker-compose.shared.admin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ services:
55
depends_on:
66
- db
77
env_file:
8-
- env-pgadmin.env
8+
- .env
99
proxy:
1010
image: traefik:v1.7
1111
volumes:
1212
- /var/run/docker.sock:/var/run/docker.sock
1313
flower:
1414
image: mher/flower
1515
env_file:
16-
- env-flower.env
16+
- .env
1717
command:
1818
- "--broker=amqp://guest@queue:5672//"
1919
# For the "Broker" tab to work in the flower UI, uncomment the following command argument,

{{cookiecutter.project_slug}}/docker-compose.shared.env.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,18 @@ version: '3.3'
22
services:
33
db:
44
env_file:
5-
- env-postgres.env
5+
- .env
66
environment:
77
- PGDATA=/var/lib/postgresql/data/pgdata
88
backend:
99
env_file:
10-
- env-postgres.env
11-
- env-backend.env
10+
- .env
1211
environment:
1312
- SERVER_NAME=${DOMAIN}
1413
- SERVER_HOST=https://${DOMAIN}
1514
celeryworker:
1615
env_file:
17-
- env-postgres.env
18-
- env-backend.env
16+
- .env
1917
environment:
2018
- SERVER_NAME=${DOMAIN}
2119
- SERVER_HOST=https://${DOMAIN}

{{cookiecutter.project_slug}}/docker-compose.test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ services:
66
dockerfile: tests.dockerfile
77
command: bash -c "while true; do sleep 1; done"
88
env_file:
9-
- env-backend.env
10-
- env-postgres.env
9+
- .env
1110
environment:
1211
- SERVER_NAME=backend
1312
- SERVER_HOST=http://${DOMAIN}

{{cookiecutter.project_slug}}/env-backend.env

Lines changed: 0 additions & 15 deletions
This file was deleted.

{{cookiecutter.project_slug}}/env-flower.env

Lines changed: 0 additions & 1 deletion
This file was deleted.

{{cookiecutter.project_slug}}/env-pgadmin.env

Lines changed: 0 additions & 3 deletions
This file was deleted.

{{cookiecutter.project_slug}}/env-postgres.env

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)