Skip to content
Snippets Groups Projects
Commit b009b2cf authored by Christian Boettcher's avatar Christian Boettcher
Browse files

update dockerfile and readme to match the new structure

parent 061bd008
No related branches found
No related tags found
1 merge request!1apiserver based on fastAPI
......@@ -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
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment