|
| 1 | +--- |
| 2 | +title: Installation |
| 3 | +parent: Documentation |
| 4 | +nav_order: 1 |
| 5 | +--- |
| 6 | + |
| 7 | +# Installation |
| 8 | +Installation of Open SPM Registry. The server can be run either from source or from a docker image. |
| 9 | +{: .fs-6 .fw-300 } |
| 10 | + |
| 11 | +## Docker Image |
| 12 | +The docker image is the easiest way to run the server. They can be built from source or pulled from dockerhub. |
| 13 | +Its recommended to build the image from source especially if you want to adjust the configuration and keep it versioned on you docker server. |
| 14 | +### Prebuilt Image |
| 15 | +The prebuilt image is available on [dockerhub](https://hub.docker.com/r/wgr1984/openspmregistry). |
| 16 | +``` |
| 17 | +docker pull wgr1984/openspmregistry:latest |
| 18 | +``` |
| 19 | +### Build docker image |
| 20 | +To build the docker image from source we need to clone the repository and build it. |
| 21 | +``` |
| 22 | +> git clone [email protected]:wgr1984/openspmregistry.git |
| 23 | +> cd openspmregistry |
| 24 | +> make build-docker |
| 25 | +``` |
| 26 | +This will build the docker image with the name `wgr1984/openspmregistry:latest`. |
| 27 | + |
| 28 | +### Run docker image |
| 29 | +To run the docker image we need to mount the files and the configuration. |
| 30 | + |
| 31 | +`-v ./files:/app/files ` will mount the files directory to the container. |
| 32 | + |
| 33 | +`-v ./config.local.yml:/app/config.local.yml` will mount the configuration file to the container. |
| 34 | +-> [Configuration](#configuration) |
| 35 | + |
| 36 | +same can be done with the certificates if needed. |
| 37 | +``` |
| 38 | +> docker run -p 8080:8080 \ |
| 39 | + -v ./files:/app/files \ |
| 40 | + -v ./config.local.yml:/app/config.local.yml \ |
| 41 | + -i -t wgr1984/openspmregistry:latest |
| 42 | +``` |
| 43 | + |
| 44 | +## Source |
| 45 | +To run the server from source we need to clone the repository and build it. |
| 46 | +``` |
| 47 | +> git clone [email protected]:wgr1984/openspmregistry.git |
| 48 | +> cd openspmregistry |
| 49 | +> make build |
| 50 | +``` |
| 51 | +### Configuration |
| 52 | +Check the configuration by copying 'config.yml' to 'config.local.yml' and adjust it to your needs. |
| 53 | +``` |
| 54 | +> cp config.yml config.local.yml |
| 55 | +``` |
| 56 | +```yaml |
| 57 | +# config.local.yml |
| 58 | +server: |
| 59 | + hostname: 127.0.0.1 |
| 60 | + port: 8080 |
| 61 | + certs: |
| 62 | + cert: server.crt |
| 63 | + key: server.key |
| 64 | + repo: |
| 65 | + type: file |
| 66 | + path: ./files/ |
| 67 | + publish: |
| 68 | + maxSize: 204800 |
| 69 | + auth: |
| 70 | + enabled: false |
| 71 | +``` |
| 72 | +e.g. to enable auth set `enabled: true`, set `type: basic` and add users to `users` array |
| 73 | +```yaml |
| 74 | + type: basic |
| 75 | + users: |
| 76 | + - username: admin |
| 77 | + password: admin |
| 78 | +``` |
| 79 | +then we can run it |
| 80 | +### Run |
| 81 | +``` |
| 82 | +./openspmregistry -tls=true -v |
| 83 | +``` |
| 84 | +
|
| 85 | +{: .highlight } |
| 86 | +ℹ️ `-tls=true` is needed to enable `https`, if you want to use http set it to false (e.g. setup behind nginx proxy) |
| 87 | +it will use `server.crt` and `server.key` as certificates. |
| 88 | +
|
0 commit comments