Skip to content

Commit 5a8a891

Browse files
committed
refactor(api): use better structure inside the image
1 parent 36a2347 commit 5a8a891

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

api/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM python:3.11.3-slim-buster
22

3+
WORKDIR /app
4+
35
RUN apt-get update
46
# working with timezones
57
RUN apt-get install --no-install-recommends --yes tzdata
@@ -13,7 +15,6 @@ RUN --mount=source=dist,target=/dist PYTHONDONTWRITEBYTECODE=1 pip install --no-
1315
ARG VCS_REVISION
1416
RUN echo "$VCS_REVISION" > version
1517

16-
COPY src/rkapi .
17-
18-
EXPOSE 5000
19-
CMD ["gunicorn", "autoapp:app", "-b", "0.0.0.0:5000"]
18+
COPY src .
19+
COPY gunicorn.conf.py gunicorn.conf.py
20+
COPY config.example.yml config.yml

api/compose.example.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ services:
77
- '5000:5000'
88
environment:
99
- TZ=Asia/Jakarta
10-
- FLASK_APP=autoapp.py
11-
- FLASK_ENV=production
12-
- FLASK_DEBUG=0
1310

14-
# server
11+
#
12+
# Server
1513
- APP_HOST=0.0.0.0 # default 0.0.0.0
14+
# If you change this, make sure to update the `ports` as well.
1615
- APP_PORT=5000 # default 8000
1716

17+
#
18+
# Database
1819
- DB_NAME=knotdb # don't add whitespace between =
1920
- DB_HOST=roach
2021
- DB_PORT=26257
@@ -34,4 +35,4 @@ services:
3435
# - RESTKNOT_CONFIG_FILE=
3536

3637
# default timeout:30
37-
command: gunicorn 'autoapp:app' -c 'gunicorn.conf.py' --timeout 60
38+
command: gunicorn "rkapi.autoapp:app" --config "gunicorn.conf.py" --timeout 60
File renamed without changes.

0 commit comments

Comments
 (0)