Skip to content

Commit ff55ec3

Browse files
committed
re-dockerise the api and database
1 parent 4ea1e14 commit ff55ec3

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

docker-compose.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@ version: "3.7"
22

33
services:
44
api:
5-
image: python:3.9.1-buster
6-
build: mystbin/rest
5+
build: mystbin/backend
76
ports:
87
- 127.0.0.1:5557:9000/tcp
98
volumes:
109
- ./mystbin/database/schema.sql:/etc/schema.sql:ro
1110
- ./config.json:/usr/src/app/config.json:ro
12-
container_name: "staging-api"
11+
container_name: "mystbin-api"
1312
networks:
1413
main:
1514
ipv4_address: 172.25.0.11
1615
depends_on:
1716
- database
1817

1918
database:
20-
image: postgres:13-alpine
19+
image: postgres:14-alpine
2120
ports:
2221
- 127.0.0.1:5558:5432
23-
container_name: "staging-database"
22+
container_name: "mystbin-database"
2423
volumes:
2524
- postgresdata:/var/lib/postgresql/data/pgdata
25+
- ./mystbin/database/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro
2626
environment:
2727
POSTGRES_DB: mystbin
2828
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
@@ -40,7 +40,7 @@ services:
4040
- ./config.json:/app/config.json:ro
4141
ports:
4242
- 127.0.0.1:5559:3000
43-
container_name: "staging-frontend"
43+
container_name: "mystbin-frontend"
4444
build: ./mystbin/frontend
4545
depends_on:
4646
- api

mystbin/backend/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM python:3.9.1-buster
1+
FROM python:3.9-slim
22

33
WORKDIR /usr/src/app
44

55
COPY . ./
66
RUN pip install --no-cache-dir -U -r requirements.txt
77
ENV ISDOCKER=true
88

9-
CMD ["python", "main.py"]
9+
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "9000"]

mystbin/backend/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ sentry-sdk==1.5.3
1010
starlette-prometheus==0.9.0
1111
typing-extensions==4.0.1
1212
ujson==5.1.0
13-
uvicorn[standard]==0.17.0
13+
uvicorn[standard]==0.18.0
1414
yarl
1515
aioconsole
1616
tabulate
17-
aioredis>2<3
17+
aioredis>2<3

0 commit comments

Comments
 (0)