Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/actions/build-server/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ runs:
id: build
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a #v7.3.0
with:
context: .
context: ./server
build-contexts: |
sdk=./sdk
file: ./server/docker/${{ inputs.server-profile }}/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
10 changes: 5 additions & 5 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ See [below](#options) on how to configure this.
Pre-built images are published to [Docker Hub][11] on every release.
Pull the latest version via:
```
$ docker pull eclipsebasyx/basyx-python-server:latest
$ docker pull eclipsebasyx/basyx-python-repository:latest
```

Or pin to a specific release by replacing `<version>` with the desired release number:
```
$ docker pull eclipsebasyx/basyx-python-server:<version>
$ docker pull eclipsebasyx/basyx-python-repository:<version>
```

## Building

If you need to build the image locally (e.g. for development), run:
If you need to build an image locally (e.g. for development), run in this directory:
```
$ docker build -t basyx-python-server -f Dockerfile ..
$ docker build -t basyx-python-repository -f docker/repository/Dockerfile --build-context sdk=../sdk .
```

Note that when cloning this repository on Windows, Git may convert the line separators to CRLF. This breaks [`entrypoint.sh`](docker/repository/entrypoint.sh) and [`stop-supervisor.sh`](docker/common/stop-supervisor.sh). Ensure both files use LF line separators (`\n`) before building.
Expand Down Expand Up @@ -96,7 +96,7 @@ The server can also be run directly on the host system without Docker, NGINX and
1. Install the local SDK and the local server package.
```bash
$ pip install ../sdk
$ pip install ./app
$ pip install .
```

2. Run the server by executing the main function in [`./app/interfaces/repository.py`](./app/interfaces/repository.py).
Expand Down
16 changes: 8 additions & 8 deletions server/docker/discovery/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ RUN apk update && \
pip install uwsgi && \
apk del git bash

COPY ./sdk /sdk
COPY ./server/app /server/app
COPY ./server/pyproject.toml /server/pyproject.toml
COPY ./server/docker/discovery/uwsgi.ini /etc/uwsgi/
COPY ./server/docker/common/supervisord.ini /etc/supervisor/conf.d/supervisord.ini
COPY ./server/docker/common/stop-supervisor.sh /etc/supervisor/stop-supervisor.sh
COPY --from=sdk . /sdk
COPY ./app /server/app
COPY ./pyproject.toml /server/pyproject.toml
COPY ./docker/discovery/uwsgi.ini /etc/uwsgi/
COPY ./docker/common/supervisord.ini /etc/supervisor/conf.d/supervisord.ini
COPY ./docker/common/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 @@ -36,7 +36,7 @@ ENV CLIENT_BODY_BUFFER_SIZE=1M
ENV API_BASE_PATH=/api/v3.1/

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

ENTRYPOINT ["/entrypoint.sh"]
Expand All @@ -47,4 +47,4 @@ WORKDIR /server/app
RUN pip install ../../sdk
RUN pip install ..

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.ini"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.ini"]
16 changes: 8 additions & 8 deletions server/docker/registry/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ RUN apk update && \
apk del git bash


COPY ./sdk /sdk
COPY ./server/app /server/app
COPY ./server/pyproject.toml /server/pyproject.toml
COPY ./server/docker/registry/uwsgi.ini /etc/uwsgi/
COPY ./server/docker/common/supervisord.ini /etc/supervisor/conf.d/supervisord.ini
COPY ./server/docker/common/stop-supervisor.sh /etc/supervisor/stop-supervisor.sh
COPY --from=sdk . /sdk
COPY ./app /server/app
COPY ./pyproject.toml /server/pyproject.toml
COPY ./docker/registry/uwsgi.ini /etc/uwsgi/
COPY ./docker/common/supervisord.ini /etc/supervisor/conf.d/supervisord.ini
COPY ./docker/common/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 @@ -44,7 +44,7 @@ ENV STORAGE_OVERWRITE=False
VOLUME ["/input", "/storage"]

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

ENTRYPOINT ["/entrypoint.sh"]
Expand All @@ -55,4 +55,4 @@ WORKDIR /server/app
RUN pip install ../../sdk
RUN pip install ..

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.ini"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.ini"]
14 changes: 7 additions & 7 deletions server/docker/repository/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ RUN apk update && \

# Copy only the files we need to run the container
# The argumentation for this is to keep the containers as slim as possible.
COPY ./sdk /sdk
COPY ./server/app /server/app
COPY ./server/pyproject.toml /server/pyproject.toml
COPY ./server/docker/repository/uwsgi.ini /etc/uwsgi/
COPY ./server/docker/common/supervisord.ini /etc/supervisor/conf.d/supervisord.ini
COPY ./server/docker/common/stop-supervisor.sh /etc/supervisor/stop-supervisor.sh
COPY --from=sdk . /sdk
COPY ./app /server/app
COPY ./pyproject.toml /server/pyproject.toml
COPY ./docker/repository/uwsgi.ini /etc/uwsgi/
COPY ./docker/common/supervisord.ini /etc/supervisor/conf.d/supervisord.ini
COPY ./docker/common/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 @@ -45,7 +45,7 @@ ENV STORAGE_OVERWRITE=False
VOLUME ["/input", "/storage"]

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

ENTRYPOINT ["/entrypoint.sh"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ name: basyx-python-server
services:
app:
build:
context: ../../..
dockerfile: server/docker/discovery/Dockerfile
context: ../..
additional_contexts:
- sdk=../../../sdk
dockerfile: ./docker/discovery/Dockerfile
ports:
- "8084:80"
environment:
Expand Down
6 changes: 4 additions & 2 deletions server/example_configurations/registry_standalone/compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
services:
app:
build:
context: ../../..
dockerfile: server/docker/registry/Dockerfile
context: ../..
additional_contexts:
- sdk=../../../sdk
dockerfile: ./docker/registry/Dockerfile
ports:
- "8083:80"
volumes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ name: basyx-python-server
services:
app:
build:
context: ../../..
dockerfile: server/docker/repository/Dockerfile
context: ../..
additional_contexts:
- sdk=../../../sdk
dockerfile: ./docker/repository/Dockerfile
ports:
- "8080:80"
volumes:
Expand Down
1 change: 1 addition & 0 deletions server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ requires-python = ">=3.10"
dependencies = [
"urllib3>=1.26,<3",
"Werkzeug>=3.0.3,<4",
"basyx-python-sdk>=1.0.0" # TODO: declare proper cross-package dependencies (see issue #592)
]

[project.optional-dependencies]
Expand Down