2022-11-13 01:10:26 +01:00
|
|
|
# Containered Server
|
|
|
|
|
|
|
|
Private server based on containers and compose
|
|
|
|
|
2024-07-07 17:14:30 +02:00
|
|
|
## Disclaimer:
|
|
|
|
|
|
|
|
HE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
SOFTWARE.
|
|
|
|
|
2022-11-13 01:10:26 +01:00
|
|
|
## Repo Structure
|
|
|
|
|
|
|
|
- `./services` Service definitions
|
|
|
|
One subfolder per service with:
|
|
|
|
- `docker-compose.yml` for this service and its direct dependencies (e.g. db)
|
|
|
|
- Additional config files, possibly as template (see below)
|
|
|
|
- `./setup` Host setup
|
|
|
|
Setup information about a possible alpine host system
|
|
|
|
- `./tasks` Task definitions
|
|
|
|
- `common.yml`: Base tasks used by other tasks
|
|
|
|
- `compose.yml`: Container related tasks e.g. starting, updating, or reading logs
|
|
|
|
- `hot.yml`: Tasks related to host system maintenance
|
|
|
|
- `services.yml`: Tasks for specific services
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
- `envsubst`, most likely via gettext package. Refer to your distros docs.
|
2022-12-10 18:16:50 +01:00
|
|
|
- docker
|
|
|
|
- docker-compose
|
2019-12-07 23:40:51 +01:00
|
|
|
|
2020-02-04 19:05:07 +01:00
|
|
|
## Data Persistence
|
2019-12-07 23:40:51 +01:00
|
|
|
|
2022-11-13 01:10:26 +01:00
|
|
|
All data SHALL BE stored in `$BASE_DIR` (defaults to `/srv`), one subfolder per service.
|
2019-12-07 23:40:51 +01:00
|
|
|
|
2020-09-22 23:37:45 +02:00
|
|
|
## Secrets & Configuration
|
2019-12-07 23:40:51 +01:00
|
|
|
|
2022-06-19 17:23:23 +02:00
|
|
|
Copy from `.env.sample` and fill in your values.
|
2019-12-07 23:40:51 +01:00
|
|
|
|
2020-02-04 19:05:07 +01:00
|
|
|
## Deploy
|
2019-12-07 23:40:51 +01:00
|
|
|
|
2022-11-13 01:10:26 +01:00
|
|
|
```sh
|
2024-07-07 17:20:29 +02:00
|
|
|
./task compose:up
|
2019-12-07 23:40:51 +01:00
|
|
|
```
|
|
|
|
|
2020-09-22 23:37:45 +02:00
|
|
|
List other tasks
|
|
|
|
|
2022-11-13 01:10:26 +01:00
|
|
|
```sh
|
2020-09-22 23:37:45 +02:00
|
|
|
./task -l
|
2020-02-04 19:05:07 +01:00
|
|
|
```
|
2022-11-13 01:10:26 +01:00
|
|
|
|
|
|
|
## Templating
|
|
|
|
|
|
|
|
Filename pattern: `*.template.*`
|
|
|
|
|
2023-02-17 23:54:17 +01:00
|
|
|
Files matching the pattern are copied with the ".template." infix removed (e.g. forgejo.template.ini -> forgejo.ini).
|
2022-11-13 01:10:26 +01:00
|
|
|
Variables are replaced using shell substitution syntax (`${VARIABLE_NAME_HERE}`) using the current environment and values from `.env`.
|
|
|
|
|
|
|
|
## Host Setup
|
|
|
|
|
|
|
|
A possible alpine based host setup is described in [alpine-setup](./setup/alpine-setup.md).
|