File tree 8 files changed +77
-33
lines changed
8 files changed +77
-33
lines changed Original file line number Diff line number Diff line change 1
1
# .env files with settings and secrets
2
2
* .env
3
+ ! dev.env
Original file line number Diff line number Diff line change 1
1
@ echo off
2
2
3
- waitress-serve %* --call " everycache_api.app:create_app "
3
+ waitress-serve %* " autoapp:app "
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- waitress-serve $@ --call " everycache_api.app:create_app "
3
+ waitress-serve $@ " autoapp:app "
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- docker-compose -f docker-compose.dev.yaml up $@
2
+
3
+ docker-compose --env-file dev.env --file docker-compose.yaml --file docker-compose.dev.yaml $@
Original file line number Diff line number Diff line change
1
+ # development environment variables for docker-compose
2
+
3
+ HASHIDS_SALT = dev-hashids-salt
4
+ SECRET_KEY = dev-secret-key
5
+ POSTGRES_USER = admin
6
+ POSTGRES_PASSWORD = root
Original file line number Diff line number Diff line change
1
+ # development docker-compose; extends and overrides base docker-compose.yaml file;
2
+ # for usage example, please see dev-composition.sh
3
+
1
4
version : " 3.9"
2
5
3
6
services :
4
- db :
5
- image : postgres:latest
6
- environment :
7
- - POSTGRES_PASSWORD=password
8
7
frontend :
9
- build : frontend
10
8
ports :
11
- - 80:3000
12
- depends_on :
13
- - api
9
+ - 3000:3000
10
+
14
11
api :
15
- build : api
16
- ports :
17
- - 5000:8080
12
+ environment :
13
+ FLASK_ENV : development
14
+ FRONTEND_APP_URL : frontend:3000
15
+ HASHIDS_SALT : dev-hashids-salt
16
+ SECRET_KEY : dev-secret-key
17
+ command : flask run --host 0.0.0.0
18
18
volumes :
19
19
- ./api:/code
20
- command : ["waitress-serve", "autoapp:app"]
21
- environment :
22
- - DATABASE_URI=${DATABASE_URI}
23
- - FLASK_APP=${FLASK_APP}
24
- - FLASK_ENV=${FLASK_ENV}
25
- - SECRET_KEY=${SECRET_KEY}
26
- - HASHIDS_SALT=${HASHIDS_SALT}
27
- - FRONTEND_APP_URL=${FRONTEND_APP_URL}
28
- - REDIS_URL=${REDIS_URL}
29
- depends_on :
30
- - redis
31
- - db
20
+ ports :
21
+ - 5000:5000
22
+
23
+ database :
24
+ ports :
25
+ - 5432:5432
26
+
32
27
redis :
33
- image : redis:alpine
34
28
ports :
35
29
- 6379:6379
30
+
36
31
redis-commander :
37
32
image : rediscommander/redis-commander:latest
33
+ depends_on :
34
+ - redis
38
35
environment :
39
- - REDIS_HOST= redis
40
- - REDIS_PORT= 6379
36
+ REDIS_HOST : redis
37
+ REDIS_PORT : 6379
41
38
ports :
42
39
- 8081:8081
Original file line number Diff line number Diff line change
1
+ # "production" docker-compose; this file is added by default by docker-compose,
2
+ # unless --file is specified and is skipped in dev-composition.sh
3
+
4
+ version : " 3.9"
5
+
6
+ services :
7
+ frontend :
8
+ ports :
9
+ - 80:3000
10
+
11
+ api :
12
+ environment :
13
+ FLASK_ENV : production
14
+ FRONTEND_APP_URL : frontend:8080
Original file line number Diff line number Diff line change
1
+ # base docker-compose; docker-compose.override.yaml is added by default by docker-compose,
2
+ # unless --file is specified and is manually added in dev-composition.sh
3
+
1
4
version : " 3.9"
2
5
3
6
services :
4
7
frontend :
5
8
build : frontend
6
- ports :
7
- - 80:3000
8
9
depends_on :
9
10
- api
11
+
10
12
api :
11
13
build : api
12
- ports :
13
- - 5000:8080
14
14
depends_on :
15
+ - database
15
16
- redis
17
+ environment :
18
+ DATABASE_URI : postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/everycache
19
+ FLASK_APP : autoapp:app
20
+ FLASK_ENV :
21
+ FRONTEND_APP_URL :
22
+ HASHIDS_ALPHABET :
23
+ HASHIDS_SALT :
24
+ JWT_ACCESS_TOKEN_EXPIRY_MINUTES :
25
+ JWT_REFRESH_TOKEN_EXPIRY_MINUTES :
26
+ REDIS_URL : redis://redis:6379/0
27
+ SECRET_KEY :
28
+
29
+ database :
30
+ image : postgres:latest
31
+ environment :
32
+ POSTGRES_DB : everycache
33
+ POSTGRES_USER :
34
+ POSTGRES_PASSWORD :
35
+ volumes :
36
+ - database-data:/var/lib/postgresql/data
37
+
16
38
redis :
17
39
image : redis:alpine
40
+
41
+ volumes :
42
+ database-data :
You can’t perform that action at this time.
0 commit comments