|
| 1 | +--- |
| 2 | +sidebar_label: Standalone Docker image |
| 3 | +sidebar_position: 1 |
| 4 | +--- |
| 5 | + |
| 6 | +# Install Dirigent using the standalone Docker image |
| 7 | + |
| 8 | +The easiest way to install Dirigent is by using our standalone Docker images, which bundle all services required for |
| 9 | +Dirigent into one, including a web server, database and a background worker. The standalone Docker images are available |
| 10 | +[on GitHub][github-docker-images]. |
| 11 | + |
| 12 | +## Examples |
| 13 | + |
| 14 | +### Docker command |
| 15 | + |
| 16 | +```bash |
| 17 | +docker volume create dirigent-data |
| 18 | + |
| 19 | +docker container run -d \ |
| 20 | + --name dirigent \ |
| 21 | + -p "7015:7015" \ |
| 22 | + -v /path/to/dirigent/config:/srv/config \ |
| 23 | + -v dirigent-data:/srv/data \ |
| 24 | + ghcr.io/codedmonkey/dirigent:0.3 |
| 25 | +``` |
| 26 | + |
| 27 | +### Docker Compose configuration |
| 28 | + |
| 29 | +```yaml |
| 30 | +services: |
| 31 | + dirigent: |
| 32 | + image: ghcr.io/codedmonkey/dirigent:0.3 |
| 33 | + ports: |
| 34 | + - "7015:7015" |
| 35 | + volumes: |
| 36 | + - ./config:/srv/config |
| 37 | + - data:/srv/data |
| 38 | + |
| 39 | +volumes: |
| 40 | + data: |
| 41 | +``` |
| 42 | +
|
| 43 | +## Volumes |
| 44 | +
|
| 45 | +Both the `/srv/config` and `/srv/data` directories are configured as volumes, both need to be retained as the config |
| 46 | +directory contains encryption keys for sensitive data so make sure to mount it. It's recommend to store the |
| 47 | +configuration and data in separate locations, see our [security guide](../security.md) for more information. |
| 48 | + |
| 49 | +## Configuring Dirigent in the image |
| 50 | + |
| 51 | +When booting from the Docker image, Dirigent will look for custom configuration in the `/srv/config` directory. Make |
| 52 | +sure to mount it in the container as a volume, in the example Docker Compose configuration it's mounted from the |
| 53 | +`config/` directory located in your Docker Compose project. |
| 54 | + |
| 55 | +Create a file in the config directory called `dirigent.yaml` and add the following contents: |
| 56 | + |
| 57 | +```yaml |
| 58 | +dirigent: |
| 59 | + title: My Dirigent |
| 60 | + slug: my-dirigent |
| 61 | + security: |
| 62 | + public: false # Only enable public access if your instance is located behind a firewall |
| 63 | + registration: false # Only enable registration if your instance is located behind a firewall |
| 64 | +``` |
| 65 | + |
| 66 | +For a complete list of configuration options, see the [Configuration Reference][docs-configuration-reference]. |
| 67 | + |
| 68 | +## Running the image |
| 69 | + |
| 70 | +After following the steps above you're ready to boot the image, so run the Docker command to start your |
| 71 | +container. |
| 72 | + |
| 73 | +By default, Dirigent is exposed on port `7015` so go to `http://localhost:7015` in your browser to access your |
| 74 | +Dirigent installation. |
| 75 | + |
| 76 | +_Note that Composer requires registries to use https by default._ |
| 77 | + |
| 78 | +Now that you've installed Dirigent on your system, it's time to [get started][docs-getting-started]! |
| 79 | + |
| 80 | +## Building the standalone Docker image |
| 81 | + |
| 82 | +To build the standalone Docker image, clone [the Dirigent repository][github] and checkout the version or |
| 83 | +commit you want to build. Simply run the `docker build` command inside the repository to build the image. |
| 84 | + |
| 85 | +```shell |
| 86 | +git clone https://github.com/codedmonkey/dirigent.git |
| 87 | +cd dirigent |
| 88 | +git checkout v0.3.1 |
| 89 | +docker build -t dirigent-standalone . |
| 90 | +``` |
| 91 | + |
| 92 | +### Change UID and GID |
| 93 | + |
| 94 | +The standalone Docker image runs as user `1000:1000`. To run the image with a different UID or GID, you can pass both |
| 95 | +a `UID` and `GID` build argument to the `docker build` command. |
| 96 | + |
| 97 | +```shell |
| 98 | +docker build -t dirigent-standalone --build-arg UID=1011 --build-arg GID=1110 . |
| 99 | +``` |
| 100 | + |
| 101 | +[docs-configuration-reference]: ../configuration-reference.md |
| 102 | +[docs-getting-started]: ../getting-started.md |
| 103 | +[github]: https://github.com/codedmonkey/dirigent |
| 104 | +[github-docker-images]: https://github.com/codedmonkey/dirigent/pkgs/container/dirigent |
0 commit comments