Move the Dockerfile to server, delete and add docker-compose.yml and nginx.conf to the server/README.md, move the docker.yml workflow in doc.yml and use buildx. Fix the path of the URL generated in the YASGUI interface to take into account when the server is deployed on a subpath (e.g. http://oxigraph.org/sparql)
parent
3cbdda9a33
commit
d2eea24c96
@ -1,53 +0,0 @@ |
|||||||
name: Publish Docker image |
|
||||||
|
|
||||||
on: |
|
||||||
workflow_dispatch: |
|
||||||
push: |
|
||||||
# Publish `master` branch as Docker `latest` image. |
|
||||||
branches: |
|
||||||
- master |
|
||||||
paths: |
|
||||||
- 'Dockerfile' |
|
||||||
- 'lib/**' |
|
||||||
- 'server/**' |
|
||||||
- '.github/workflows/docker.yml' |
|
||||||
# Publish `v0.1.2` release as image tag `0.1.2`. |
|
||||||
release: |
|
||||||
types: [published] |
|
||||||
|
|
||||||
jobs: |
|
||||||
build-and-publish: |
|
||||||
runs-on: ubuntu-latest |
|
||||||
steps: |
|
||||||
- uses: actions/checkout@v2 |
|
||||||
with: |
|
||||||
submodules: 'recursive' |
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry |
|
||||||
uses: docker/login-action@v1 |
|
||||||
with: |
|
||||||
registry: ghcr.io |
|
||||||
username: ${{github.actor}} |
|
||||||
password: ${{secrets.GITHUB_TOKEN}} |
|
||||||
|
|
||||||
- name: Generate image ID and version |
|
||||||
run: | |
|
||||||
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/oxigraph |
|
||||||
# Change all uppercase to lowercase |
|
||||||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') |
|
||||||
# Strip git ref prefix from version |
|
||||||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') |
|
||||||
# Strip "v" prefix from tag name |
|
||||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') |
|
||||||
# Use Docker `latest` tag convention |
|
||||||
[ "$VERSION" == "master" ] && VERSION=latest |
|
||||||
echo "IMAGE_ID=$IMAGE_ID" >> $GITHUB_ENV |
|
||||||
echo "VERSION=$VERSION" >> $GITHUB_ENV |
|
||||||
|
|
||||||
- name: Build docker image |
|
||||||
run: | |
|
||||||
docker build -t $IMAGE_ID:$VERSION . |
|
||||||
|
|
||||||
- name: Push docker image |
|
||||||
run: | |
|
||||||
docker push $IMAGE_ID:$VERSION |
|
@ -1,22 +1,23 @@ |
|||||||
version: "3" |
version: "3" |
||||||
|
|
||||||
services: |
services: |
||||||
|
|
||||||
oxigraph: |
oxigraph: |
||||||
# image: oxigraph/oxigraph |
# image: ghcr.io/oxigraph/oxigraph |
||||||
build: . |
## To build from local source code: |
||||||
|
build: |
||||||
|
context: . |
||||||
|
dockerfile: server/Dockerfile |
||||||
volumes: |
volumes: |
||||||
- ./data:/data |
- ./data:/data |
||||||
|
|
||||||
nginx-auth: |
nginx-auth: |
||||||
image: nginx:1.21.4 |
image: nginx:1.21.4 |
||||||
|
environment: |
||||||
|
- OXIGRAPH_USER=oxigraph |
||||||
|
- OXIGRAPH_PASSWORD=oxigraphy |
||||||
volumes: |
volumes: |
||||||
- ./server/nginx.conf:/etc/nginx/nginx.conf |
- ./nginx.conf:/etc/nginx/nginx.conf |
||||||
## For multiple users: uncomment this line to use your local .htpasswd file: |
## For multiple users: uncomment this line to mount a pre-generated .htpasswd |
||||||
# - ./.htpasswd:/etc/nginx/.htpasswd |
# - ./.htpasswd:/etc/nginx/.htpasswd |
||||||
ports: |
ports: |
||||||
- 7878:7878 |
- 7878:7878 |
||||||
environment: |
|
||||||
- OXIGRAPH_USER=${OXIGRAPH_USER:-oxigraph} |
|
||||||
- OXIGRAPH_PASSWORD=${OXIGRAPH_PASSWORD:-oxigraphy} |
|
||||||
entrypoint: "bash -c 'echo -n $OXIGRAPH_USER: >> /etc/nginx/.htpasswd && echo $OXIGRAPH_PASSWORD | openssl passwd -stdin -apr1 >> /etc/nginx/.htpasswd && /docker-entrypoint.sh nginx'" |
entrypoint: "bash -c 'echo -n $OXIGRAPH_USER: >> /etc/nginx/.htpasswd && echo $OXIGRAPH_PASSWORD | openssl passwd -stdin -apr1 >> /etc/nginx/.htpasswd && /docker-entrypoint.sh nginx'" |
@ -1,35 +1,23 @@ |
|||||||
|
daemon off; |
||||||
events { |
events { |
||||||
worker_connections 1024; |
worker_connections 1024; |
||||||
} |
} |
||||||
daemon off; |
|
||||||
http { |
http { |
||||||
server { |
server { |
||||||
server_name localhost; |
server_name localhost; |
||||||
listen 7878; |
listen 7878; |
||||||
|
|
||||||
rewrite ^/(.*) /$1 break; |
rewrite ^/(.*) /$1 break; |
||||||
proxy_ignore_client_abort on; |
proxy_ignore_client_abort on; |
||||||
proxy_set_header X-Real-IP $remote_addr; |
proxy_set_header X-Real-IP $remote_addr; |
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
||||||
proxy_set_header Host $http_host; |
proxy_set_header Host $http_host; |
||||||
|
|
||||||
# Enable CORS requests |
|
||||||
proxy_set_header Access-Control-Allow-Origin "*"; |
proxy_set_header Access-Control-Allow-Origin "*"; |
||||||
|
|
||||||
location ~ ^(/|/query)$ { |
location ~ ^(/|/query)$ { |
||||||
# limit_except GET POST OPTIONS { |
|
||||||
# deny all; |
|
||||||
# } |
|
||||||
proxy_pass http://oxigraph:7878; |
proxy_pass http://oxigraph:7878; |
||||||
proxy_pass_request_headers on; |
proxy_pass_request_headers on; |
||||||
} |
} |
||||||
|
location ~ ^(/update|/store)$ { |
||||||
location /update { |
auth_basic "Oxigraph Administrator's Area"; |
||||||
# Auth: https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/ |
|
||||||
limit_except GET POST { |
|
||||||
deny all; |
|
||||||
} |
|
||||||
auth_basic "Oxygraph Administrator's Area"; |
|
||||||
auth_basic_user_file /etc/nginx/.htpasswd; |
auth_basic_user_file /etc/nginx/.htpasswd; |
||||||
proxy_pass http://oxigraph:7878; |
proxy_pass http://oxigraph:7878; |
||||||
proxy_pass_request_headers on; |
proxy_pass_request_headers on; |
Loading…
Reference in new issue