Skip to content

Commit 54279f0

Browse files
committed
Move file .env from src/ to / when setting it up
1 parent 46b87b2 commit 54279f0

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
@@ -13,26 +13,26 @@ services:
1313
- redis
1414
volumes:
1515
- ./src/app:/code/app
16-
- ./src/.env:/code/.env
16+
- .env:/.env
1717

1818
worker:
1919
build:
2020
context: .
2121
dockerfile: Dockerfile
2222
command: arq app.core.worker.settings.WorkerSettings
2323
env_file:
24-
- ./src/.env
24+
- .env
2525
depends_on:
2626
- db
2727
- redis
2828
volumes:
2929
- ./src/app:/code/app
30-
- ./src/.env:/code/.env
30+
- .env:/.env
3131

3232
db:
3333
image: postgres:13
3434
env_file:
35-
- ./src/.env
35+
- .env
3636
volumes:
3737
- postgres-data:/var/lib/postgresql/data
3838
expose:
@@ -61,7 +61,7 @@ services:
6161
context: .
6262
dockerfile: Dockerfile
6363
env_file:
64-
- ./src/.env
64+
- .env
6565
depends_on:
6666
- db
6767
- web
@@ -75,7 +75,7 @@ services:
7575
context: .
7676
dockerfile: Dockerfile
7777
env_file:
78-
- ./src/.env
78+
- .env
7979
depends_on:
8080
- db
8181
- create_superuser
@@ -90,7 +90,7 @@ services:
9090
# context: .
9191
# dockerfile: Dockerfile
9292
# env_file:
93-
# - ./src/.env
93+
# - .env
9494
# depends_on:
9595
# - create_superuser
9696
# - 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)