Skip to content

Commit d5249a0

Browse files
committed
Move file .env from src/ to / when setting it up
1 parent af5eb63 commit d5249a0

File tree

6 files changed

+40
-41
lines changed

6 files changed

+40
-41
lines changed

scripts/gunicorn_managing_uvicorn_workers/.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file contains example values for development/testing purposes only.
55
#
66
# SECURITY CRITICAL: Before deploying to production, you MUST:
7-
# 1. Copy this file to src/.env
7+
# 1. Copy this file to a .env file at the project root
88
# 2. Generate a new SECRET_KEY using: openssl rand -hex 32
99
# 3. Change all passwords (POSTGRES_PASSWORD, ADMIN_PASSWORD, etc.)
1010
# 4. Update all sensitive configuration values
@@ -20,7 +20,7 @@ CONTACT_NAME="Me"
2020
CONTACT_EMAIL="[email protected]"
2121
LICENSE_NAME="MIT"
2222

23-
# ------------- database -------------
23+
# ------------- database -------------
2424
POSTGRES_USER="postgres"
2525
POSTGRES_PASSWORD=1234
2626
POSTGRES_SERVER="db"

scripts/gunicorn_managing_uvicorn_workers/docker-compose.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
web:
3-
build:
3+
build:
44
context: .
55
dockerfile: Dockerfile
66
# -------- Both of the following commands should be commented to run with nginx --------
@@ -9,7 +9,7 @@ services:
99
# command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
1010
command: gunicorn app.main:app -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000
1111
env_file:
12-
- ./src/.env
12+
- .env
1313
# -------- replace with expose if you are using nginx --------
1414
ports:
1515
- "8000:8000"
@@ -20,26 +20,26 @@ services:
2020
- redis
2121
volumes:
2222
- ./src/app:/code/app
23-
- ./src/.env:/code/.env
23+
- .env:/.env
2424

2525
worker:
26-
build:
26+
build:
2727
context: .
2828
dockerfile: Dockerfile
2929
command: arq app.core.worker.settings.WorkerSettings
3030
env_file:
31-
- ./src/.env
31+
- .env
3232
depends_on:
3333
- db
3434
- redis
3535
volumes:
3636
- ./src/app:/code/app
37-
- ./src/.env:/code/.env
37+
- .env:/.env
3838

3939
db:
4040
image: postgres:13
4141
env_file:
42-
- ./src/.env
42+
- .env
4343
volumes:
4444
- postgres-data:/var/lib/postgresql/data
4545
expose:
@@ -64,11 +64,11 @@ services:
6464

6565
#-------- uncomment to create first superuser --------
6666
create_superuser:
67-
build:
67+
build:
6868
context: .
6969
dockerfile: Dockerfile
7070
env_file:
71-
- ./src/.env
71+
- .env
7272
depends_on:
7373
- db
7474
- web
@@ -78,11 +78,11 @@ services:
7878

7979
#-------- uncomment to run tests --------
8080
# pytest:
81-
# build:
81+
# build:
8282
# context: .
83-
# dockerfile: Dockerfile
83+
# dockerfile: Dockerfile
8484
# env_file:
85-
# - ./src/.env
85+
# - .env
8686
# depends_on:
8787
# - db
8888
# - create_superuser
@@ -93,11 +93,11 @@ services:
9393

9494
#-------- uncomment to create first tier --------
9595
# create_tier:
96-
# build:
96+
# build:
9797
# context: .
9898
# dockerfile: Dockerfile
9999
# env_file:
100-
# - ./src/.env
100+
# - .env
101101
# depends_on:
102102
# - create_superuser
103103
# - db
@@ -109,4 +109,3 @@ services:
109109
volumes:
110110
postgres-data:
111111
redis-data:
112-

scripts/local_with_uvicorn/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file contains example values for development/testing purposes only.
55
#
66
# SECURITY CRITICAL: Before deploying to production, you MUST:
7-
# 1. Copy this file to src/.env
7+
# 1. Copy this file to a .env file at the project root
88
# 2. Generate a new SECRET_KEY using: openssl rand -hex 32
99
# 3. Change all passwords (POSTGRES_PASSWORD, ADMIN_PASSWORD, etc.)
1010
# 4. Update all sensitive configuration values

scripts/local_with_uvicorn/docker-compose.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@ services:
1010
- redis
1111
volumes:
1212
- ./src/app:/code/app
13-
- ./src/.env:/code/.env
13+
- .env:/.env
1414

1515
worker:
1616
build:
1717
context: .
1818
dockerfile: Dockerfile
1919
command: arq app.core.worker.settings.WorkerSettings
2020
env_file:
21-
- ./src/.env
21+
- .env
2222
depends_on:
2323
- db
2424
- redis
2525
volumes:
2626
- ./src/app:/code/app
27-
- ./src/.env:/code/.env
27+
- .env:/.env
2828

2929
db:
3030
image: postgres:13
3131
env_file:
32-
- ./src/.env
32+
- .env
3333
volumes:
3434
- postgres-data:/var/lib/postgresql/data
3535
expose:
@@ -58,7 +58,7 @@ services:
5858
context: .
5959
dockerfile: Dockerfile
6060
env_file:
61-
- ./src/.env
61+
- .env
6262
depends_on:
6363
- db
6464
- web
@@ -72,7 +72,7 @@ services:
7272
context: .
7373
dockerfile: Dockerfile
7474
env_file:
75-
- ./src/.env
75+
- .env
7676
depends_on:
7777
- db
7878
- create_superuser
@@ -87,7 +87,7 @@ services:
8787
# context: .
8888
# dockerfile: Dockerfile
8989
# env_file:
90-
# - ./src/.env
90+
# - .env
9191
# depends_on:
9292
# - create_superuser
9393
# - db

scripts/production_with_nginx/.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file contains example values for development/testing purposes only.
55
#
66
# SECURITY CRITICAL: Before deploying to production, you MUST:
7-
# 1. Copy this file to src/.env
7+
# 1. Copy this file to a .env file at the project root
88
# 2. Generate a new SECRET_KEY using: openssl rand -hex 32
99
# 3. Change all passwords (POSTGRES_PASSWORD, ADMIN_PASSWORD, etc.)
1010
# 4. Update all sensitive configuration values
@@ -20,7 +20,7 @@ CONTACT_NAME="Me"
2020
CONTACT_EMAIL="[email protected]"
2121
LICENSE_NAME="MIT"
2222

23-
# ------------- database -------------
23+
# ------------- database -------------
2424
POSTGRES_USER="postgres"
2525
POSTGRES_PASSWORD=1234
2626
POSTGRES_SERVER="db"

scripts/production_with_nginx/docker-compose.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
web:
3-
build:
3+
build:
44
context: .
55
dockerfile: Dockerfile
66
# -------- Both of the following commands should be commented to run with nginx --------
@@ -9,7 +9,7 @@ services:
99
# command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
1010
command: gunicorn app.main:app -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000
1111
env_file:
12-
- ./src/.env
12+
- .env
1313
# -------- replace ports with expose if you are using nginx --------
1414
# ports:
1515
# - "8000:8000"
@@ -20,26 +20,26 @@ services:
2020
- redis
2121
volumes:
2222
- ./src/app:/code/app
23-
- ./src/.env:/code/.env
23+
- .env:/.env
2424

2525
worker:
26-
build:
26+
build:
2727
context: .
2828
dockerfile: Dockerfile
2929
command: arq app.core.worker.settings.WorkerSettings
3030
env_file:
31-
- ./src/.env
31+
- .env
3232
depends_on:
3333
- db
3434
- redis
3535
volumes:
3636
- ./src/app:/code/app
37-
- ./src/.env:/code/.env
37+
- .env:/.env
3838

3939
db:
4040
image: postgres:13
4141
env_file:
42-
- ./src/.env
42+
- .env
4343
volumes:
4444
- postgres-data:/var/lib/postgresql/data
4545
expose:
@@ -64,11 +64,11 @@ services:
6464

6565
#-------- uncomment to create first superuser --------
6666
# create_superuser:
67-
# build:
67+
# build:
6868
# context: .
6969
# dockerfile: Dockerfile
7070
# env_file:
71-
# - ./src/.env
71+
# - .env
7272
# depends_on:
7373
# - db
7474
# - web
@@ -78,11 +78,11 @@ services:
7878

7979
#-------- uncomment to run tests --------
8080
# pytest:
81-
# build:
81+
# build:
8282
# context: .
83-
# dockerfile: Dockerfile
83+
# dockerfile: Dockerfile
8484
# env_file:
85-
# - ./src/.env
85+
# - .env
8686
# depends_on:
8787
# - web
8888
# - redis
@@ -92,11 +92,11 @@ services:
9292

9393
#-------- uncomment to create first tier --------
9494
# create_tier:
95-
# build:
95+
# build:
9696
# context: .
9797
# dockerfile: Dockerfile
9898
# env_file:
99-
# - ./src/.env
99+
# - .env
100100
# depends_on:
101101
# - create_superuser
102102
# - db

0 commit comments

Comments
 (0)