Skip to content

Commit 9cdc85a

Browse files
authored
Merge pull request #207 from grillazz/198-add-simple-caching
fix granian-compose.yml
2 parents 21c2a4f + 7499337 commit 9cdc85a

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ COPY /app/ app/
5454
COPY /tests/ tests/
5555
COPY /templates/ templates/
5656
COPY .env app/
57-
COPY alembic.ini app/
58-
COPY alembic/ app/alembic/
57+
COPY alembic.ini /panettone/alembic.ini
58+
COPY /alembic/ /panettone/alembic/
5959
COPY logging-uvicorn.json /panettone/logging-uvicorn.json
60+
COPY logging-granian.json /panettone/logging-granian.json
6061
COPY pyproject.toml /panettone/pyproject.toml
6162

6263
RUN python -V

compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ services:
33
container_name: fsap_app
44
network_mode: host
55
build: .
6+
environment:
7+
- PYTHONPATH=/panettone
68
env_file:
79
- .env
810
- .secrets

granian-compose.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
services:
22
app:
33
container_name: fsap_app
4+
network_mode: host
45
build: .
6+
environment:
7+
- PYTHONPATH=/panettone
58
env_file:
69
- .env
710
- .secrets
8-
command: granian --interface asgi --host 0.0.0.0 --port 8080 --loop uvloop app.main:app --access-log --log-level debug --log-config ./logging-granian.json
11+
command: bash -c "
12+
granian --interface asgi
13+
--host 0.0.0.0 --port 8080
14+
app.main:app --access-log --log-level debug
15+
--log-config ./logging-granian.json
16+
"
917
volumes:
10-
- .:/home/code
18+
- ./app:/panettone/app
19+
- ./tests:/panettone/tests
20+
- ./templates:/panettone/templates
1121
ports:
1222
- "8080:8080"
1323
depends_on:
1424
- db
15-
- redis
25+
- inmemory
1626

1727
db:
1828
container_name: fsap_db
29+
network_mode: host
1930
build:
2031
context: ./db
2132
dockerfile: Dockerfile
@@ -41,6 +52,7 @@ services:
4152
inmemory:
4253
image: redis:latest
4354
container_name: fsap_inmemory
55+
network_mode: host
4456
ports:
4557
- "6379:6379"
4658
env_file:

0 commit comments

Comments
 (0)