From b009b2cf83f530b4b79b29ba7d27d096768f8009 Mon Sep 17 00:00:00 2001 From: Christian Boettcher <c.boettcher@fz-juelich.de> Date: Mon, 10 May 2021 11:35:43 +0200 Subject: [PATCH] update dockerfile and readme to match the new structure --- apiserver/Dockerfile | 13 +++++++++---- apiserver/README.md | 8 ++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/apiserver/Dockerfile b/apiserver/Dockerfile index a97901c..491f752 100644 --- a/apiserver/Dockerfile +++ b/apiserver/Dockerfile @@ -2,12 +2,17 @@ FROM tiangolo/uvicorn-gunicorn:python3.8 LABEL maintainer="Christian Böttcher <c.boettcher@fz-juelich.de>" -RUN mkdir -p /app/data +RUN mkdir -p /app/app/data +RUN mkdir -p /app/app/storage RUN apt update && apt upgrade -y RUN pip install --no-cache-dir fastapi -COPY ./main.py /app/ -COPY ./LocationStorage.py /app/ -COPY ./JsonFileStorageAdapter.py /app/ \ No newline at end of file +COPY ./__init__.py /app/app/ +COPY ./main.py /app/app/ +COPY ./storage/JsonFileStorageAdapter.py /app/app/storage/ +COPY ./storage/LocationStorage.py /app/app/storage/ +COPY ./storage/__init__.py /app/app/storage/ + +RUN ls -laR /app \ No newline at end of file diff --git a/apiserver/README.md b/apiserver/README.md index 90a74be..1c18aff 100644 --- a/apiserver/README.md +++ b/apiserver/README.md @@ -23,11 +23,11 @@ pip install uvicorn[standard] To start the server, run ```bash -uvicorn main:app --reload +uvicorn apiserver:app --reload --reload-dir apiserver ``` -Withour any other options, this starts your server on `<localhost:8000>`. -The `--reload` option ensures, that any changes to the `api-server.py` will cause an immediate reload of the server, which es especially interesting during development. If this is not required, just don't include the option. +Without any other options, this starts your server on `<localhost:8000>`. +The `--reload --reload-dir apiserver` options ensure, that any changes to files in the `apiserver`-directory will cause an immediate reload of the server, which is especially useful during development. If this is not required, just don't include the options. More information about uvicorn settings (including information about how to bind to other network interfaces or ports) can be found [here](https://www.uvicorn.org/settings/). @@ -49,7 +49,7 @@ while in the same directory as the Dockerfile. To run the docker image in a local container, run ```bash -docker run -d --name <container name> -p localhost:<local_port>:80 datacalog-apiserver +docker run -d --name <container name> -p 127.0.0.1:<local_port>:80 datacalog-apiserver ``` `<container name>` is the name of your container, that can be used to refer to it with other docker commands. -- GitLab