diff --git a/apiserver/Dockerfile b/apiserver/Dockerfile index a97901c34850e2ee49023bbf92060270ac66aa37..491f752e2cd3db128941869239eb3764f4813067 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 90a74be54980c019e4645fa53338790331956fad..1c18affff71ffb4f1939fe7575101a8c83b03be7 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.