chore: Build and push official docker image in CI

* docker job added to ci.yml

* removed temporary manual build stuff

* updated readme for new docker image

* updated changelog

* Revert "updated changelog"

This reverts commit 20d99a2e27e19ffb7a31cbddddb7daab8206b3c8.

Co-authored-by: Thomas Dupont <thomas.dupont@intec.ugent.be>
This commit is contained in:
Thomas 2022-01-21 11:00:48 +01:00 committed by GitHub
parent 221c8e65c7
commit 65d1eeb0a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 7 deletions

View File

@ -139,6 +139,46 @@ jobs:
github-token: ${{ secrets.github_token }} github-token: ${{ secrets.github_token }}
parallel-finished: true parallel-finished: true
docker:
needs:
- lint
- test-unit
- test-integration
- test-integration-windows
- validate-components
# Only run on tags starting with v prefix for now -- extra push need for triggering CI again
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
solidproject/community-server
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
github-token: ${{ secrets.github_token }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
docs: docs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@ -69,21 +69,20 @@ npm start -- # add parameters if needed
``` ```
### 📦 Running via Docker ### 📦 Running via Docker
Docker allows you to run the server without having Node.js installed: Docker allows you to run the server without having Node.js installed. Images are built on each tagged version and hosted on [Docker Hub](https://hub.docker.com/r/solidproject/community-server).
```shell ```shell
# Clone the repo to get access to the configs
git clone https://github.com/solid/community-server.git git clone https://github.com/solid/community-server.git
cd community-server cd community-server
# Build the Docker image
docker build --rm -f Dockerfile -t css:latest .
# Run the image, serving your `~/Solid` directory on `http://localhost:3000` # Run the image, serving your `~/Solid` directory on `http://localhost:3000`
docker run --rm -v ~/Solid:/data -p 3000:3000 -it css:latest docker run --rm -v ~/Solid:/data -p 3000:3000 -it solidproject/community-server:latest
# Or use one of the built-in configurations # Or use one of the built-in configurations
docker run --rm -p 3000:3000 -it css:latest -c config/default.json docker run --rm -p 3000:3000 -it solidproject/community-server -c config/default.json
# Or use your own configuration mapped to the right directory # Or use your own configuration mapped to the right directory
docker run --rm -v ~/solid-config:/config -p 3000:3000 -it css:latest -c /config/my-config.json docker run --rm -v ~/solid-config:/config -p 3000:3000 -it solidproject/community-server -c /config/my-config.json
``` ```
## 🔧 Configuring the server ## 🔧 Configuring the server
The Community Solid Server is designed to be flexible The Community Solid Server is designed to be flexible
such that people can easily run different configurations. such that people can easily run different configurations.