Skip to content

Commit

Permalink
install locally instead from git
Browse files Browse the repository at this point in the history
  • Loading branch information
Frosty2500 committed Dec 30, 2024
1 parent 17217b6 commit 6b8c8be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
15 changes: 9 additions & 6 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ ENV PYTHONUNBUFFERED=1
RUN apk update && \
apk add --no-cache nginx supervisor gcc musl-dev linux-headers python3-dev git bash && \
pip install uwsgi && \
pip install --no-cache-dir git+https://github.com/eclipse-basyx/basyx-python-sdk@main#subdirectory=sdk && \
apk del git bash


COPY uwsgi.ini /etc/uwsgi/
COPY supervisord.ini /etc/supervisor/conf.d/supervisord.ini
COPY stop-supervisor.sh /etc/supervisor/stop-supervisor.sh
COPY server/uwsgi.ini /etc/uwsgi/
COPY server/supervisord.ini /etc/supervisor/conf.d/supervisord.ini
COPY server/stop-supervisor.sh /etc/supervisor/stop-supervisor.sh
RUN chmod +x /etc/supervisor/stop-supervisor.sh

# Makes it possible to use a different configuration
Expand All @@ -34,12 +33,16 @@ ENV LISTEN_PORT=80
ENV CLIENT_BODY_BUFFER_SIZE=1M

# Copy the entrypoint that will generate Nginx additional configs
COPY entrypoint.sh /entrypoint.sh
COPY server/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

COPY ./app /app
ENV SETUPTOOLS_SCM_PRETEND_VERSION=1.0.0

COPY . /all
COPY ./server/app /app
WORKDIR /app
RUN pip install ../all/sdk[dev]

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.ini"]
8 changes: 4 additions & 4 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ See [below](#options) on how to configure this.
## Building
The container image can be built via:
```
$ docker buildx build -t basyx-python-sdk-http-server .
$ docker build -t basyx-python-server .
```

## Running
Expand Down Expand Up @@ -46,17 +46,17 @@ The container can be configured via environment variables:

Putting it all together, the container can be started via the following command:
```
$ docker run -p 8080:80 -v ./storage:/storage basyx-python-sdk-http-server
$ docker run -p 8080:80 -v ./storage:/storage basyx-python-server
```

Since Windows uses backslashes instead of forward slashes in paths, you'll have to adjust the path to the storage directory there:
```
> docker run -p 8080:80 -v .\storage:/storage basyx-python-sdk-http-server
> docker run -p 8080:80 -v .\storage:/storage basyx-python-server
```

Per default, the server will use the `LOCAL_FILE_READ_ONLY` storage type and serve the API under `/api/v3.0` and read files from `/storage`. If you want to change this, you can do so like this:
```
$ docker run -p 8080:80 -v ./storage2:/storage2 -e API_BASE_PATH=/api/v3.1 -e STORAGE_TYPE=LOCAL_FILE_BACKEND -e STORAGE_PATH=/storage2 basyx-python-sdk-http-server
$ docker run -p 8080:80 -v ./storage2:/storage2 -e API_BASE_PATH=/api/v3.1 -e STORAGE_TYPE=LOCAL_FILE_BACKEND -e STORAGE_PATH=/storage2 basyx-python-server
```

## Building and running the image with docker-compose
Expand Down

0 comments on commit 6b8c8be

Please sign in to comment.