Skip to content

Commit

Permalink
add more infos to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas-Heiligenbrunner committed Aug 16, 2024
1 parent 46d8afc commit 21216e5
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 41 deletions.
131 changes: 131 additions & 0 deletions docs/docs/install/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Docker Compose setup

There are two ways the packages can be built:
In both ways for each package built a seperate container is spawned and destroyed afterwards.

## DinD (Docker in Docker) build mode
The build container will spawn a new container for each package inside the main container.
For this to work the container needs to be priviledged!


Example with PostgreSQL database (recommended):
```yaml
version: '3'
services:
aurcache:
image: ghcr.io/lukas-heiligenbrunner/aurcache:latest
ports:
- "8080:8080" # Repository
- "8081:8081" # Frontend
volumes:
- ./aurcache/repo:/app/repo
privileged: true
environment:
- DB_TYPE=POSTGRESQL
- DB_USER=aurcache
- DB_PWD=YOUR_SECURE_PWD
- DB_HOST=dbhost
- MAX_CONCURRENT_BUILDS=1
- CPU_LIMIT=100
networks:
aurcache_network:
restart: unless-stopped
aurcache_database:
image: postgres:latest
volumes:
- ./aurcache/db:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=YOUR_SECURE_PWD
- POSTGRES_USER=aurcache
restart: unless-stopped
networks:
aurcache_network:
aliases:
- "dbhost"

networks:
aurcache_network:
driver: bridge
```
Example with SQLite database:
```yaml
version: '3'
services:
aurcache:
image: ghcr.io/lukas-heiligenbrunner/aurcache:latest
ports:
- "8080:8080" # Repository
- "8081:8081" # Frontend
volumes:
- ./aurcache/db:/app/db
- ./aurcache/repo:/app/repo
privileged: true
```
## Host build mode
For every package built a new container is spawned on the host system and destroyed afterwards.
For this method the docker socket needs to be mounted to the aurcache container.
Example with PostgreSQL database (recommended):
```yaml
version: '3'
services:
aurcache:
image: ghcr.io/lukas-heiligenbrunner/aurcache:latest
ports:
- "8080:8080" # Repository
- "8081:8081" # Frontend
volumes:
- ./aurcache/repo:/app/repo
- /var/run/docker.sock:/var/run/docker.sock
- artifact_cache:/app/builds
environment:
- BUILD_ARTIFACT_DIR=artifact_cache # also absolute path is possible
- DB_TYPE=POSTGRESQL
- DB_USER=aurcache
- DB_PWD=YOUR_SECURE_PWD
- DB_HOST=dbhost
aurcache_database:
image: postgres:latest
volumes:
- ./aurcache/db:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=YOUR_SECURE_PWD
- POSTGRES_USER=aurcache
restart: unless-stopped
networks:
aurcache_network:
aliases:
- "dbhost"

networks:
aurcache_network:
driver: bridge

volumes:
artifact_cache:
driver: local
```
Example with SQLite database:
```yaml
version: '3'
services:
aurcache:
image: ghcr.io/lukas-heiligenbrunner/aurcache:latest
ports:
- "8080:8080" # Repository
- "8081:8081" # Frontend
volumes:
- ./aurcache/db:/app/db
- ./aurcache/repo:/app/repo
- /var/run/docker.sock:/var/run/docker.sock
- artifact_cache:/app/builds
environment:
- BUILD_ARTIFACT_DIR=artifact_cache # also absolute path is possible
volumes:
artifact_cache:
driver: local
```
For this method to work you need to mount a exchange volume to pass the built packages to the aurcache container.
In this example the `artifact_cache` volume is mounted to the aurcache container and the `BUILD_ARTIFACT_DIR` environment variable is set to the volume.
50 changes: 11 additions & 39 deletions docs/docs/overview/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,19 @@ sidebar_position: 1

# Introduction

URCache is a build server and repository for Archlinux packages sourced from the AUR (Arch User Repository). It features a Flutter frontend and Rust backend, enabling users to add packages for building and subsequently serves them as a pacman repository. Notably, AURCache automatically detects when a package is out of date and displays it within the frontend.
AURCache is a build server and repository for Archlinux packages sourced from the AUR (Arch User Repository). It features a Flutter frontend and Rust backend, enabling users to add packages for building and subsequently serves them as a pacman repository. Notably, AURCache automatically detects when a package is out of date and displays it within the frontend.


## Usecases
## Advantages

- **Avoid repeated builds**: AURCache can be used as a build server for Archlinux packages sourced from the AUR.
- **Avoid repeated builds**: Build your packages only once on your server and not on every client.
- **Reduce CPU and memory usage**: Clients only need to download packages.
- **Reduce build time**: Build packages in parallel.
- **Reduce network traffic**: Serve packages from your local network.
- **Automatically update packages**: AURCache automatically checks for updates.
- **Customize your repository**: Add custom packages to your repository.

Get started by **creating a new site**.
## Getting Started
Get started with [Quick Start](/docs/overview/quick-start) to try it out.

Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.

### What you'll need

- [Node.js](https://nodejs.org/en/download/) version 18.0 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.

## Generate a new site

Generate a new Docusaurus site using the **classic template**.

The classic template will automatically be added to your project after you run the command:

```bash
npm init docusaurus@latest my-website classic
```

You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.

The command also installs all necessary dependencies you need to run Docusaurus.

## Start your site

Run the development server:

```bash
cd my-website
npm run start
```

The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.

The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.

Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
For advanced setup, see the [Configuration](/docs/configuration) page.
5 changes: 3 additions & 2 deletions docs/docs/overview/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 2

# Quick Start

USe the following example docker-compose.yml file to deploy AURCache using Docker and Docker-compose:
Use the following example docker-compose.yml file to deploy AURCache using Docker and Docker-compose:

```yaml
version: '3'
Expand All @@ -22,4 +22,5 @@ services:
This setup will create a sqlite database in `./aurcache/db` and a repository in `./aurcache/repo`.
I recommend using this only for testing purposes.
For production use, you should use a proper database and repository. See the [Configuration](/docs/configuration) page for more information.

For production use, you should use a proper database and resource configuration. See the [Configuration](/docs/configuration) page for more information.

0 comments on commit 21216e5

Please sign in to comment.