added docker-compose and quick run details

This commit is contained in:
Rudis Muiznieks 2022-07-19 07:53:14 -05:00
parent 4338d05cf6
commit 71e6d70521
Signed by: rudism
GPG Key ID: CABF2F86EF7884F9
7 changed files with 52 additions and 2 deletions

6
.gitignore vendored
View File

@ -1,3 +1,7 @@
data/*
data/cache/*
data/dotplan.log
data/dotplan.pid
data/msmtprc
test/data/*
.env
.pls_cache/*

View File

@ -26,6 +26,11 @@ run apk del build-base perl-dev perl-app-cpanminus wget sqlite unzip file-dev cm
copy static /opt/static
copy server.pl /opt
run adduser -u 1000 -h /opt -D dotplan
run chown -R dotplan:dotplan /opt
user dotplan
workdir /opt
entrypoint ["/usr/bin/perl", "server.pl"]

View File

@ -81,3 +81,21 @@ To facilitate service discovery by Dotplan clients and relays, add a [SRV record
```
_dotplan._tcp.example.com. 86400 IN SRV 0 1 443 dotplan.online.
```
## Docker Quick Run
```
git clone https://code.sitosis.com/rudism/dotplan-online.git
cd dotplan-online
cp data/msmtprc.example data/msmtprc
```
Edit the `Dockerfile` if you want to run as a user other than PID 1000, edit the `ENVIRONMENT` section of the `docker-compose.yaml` and make any other customizations for your setup, and edit the example provided `data/msmtprc` with your real SMTP server details (only used to send email verifications for new signups and password reset links).
```
cat schema.sql | sqlite3 data/users.db
docker-compose build
docker-compose up -d
```
You should now be able to make requests at `http://localhost:4227`, which is where you should point your reverse proxy for SSL configuration, etc.

8
data/msmtprc.example Normal file
View File

@ -0,0 +1,8 @@
account gmail
tls on
auth on
host smtp.gmail.com
port 587
user user1@gmail.com
from user1@gmail.com
password my-google-app-password

0
data/plans/.gitkeep Normal file
View File

16
docker-compose.yaml Normal file
View File

@ -0,0 +1,16 @@
services:
dotplan-online:
image: dotplan-online:latest
build: .
container_name: dotplan-online
environment:
HOSTNAME: dotplan.online
LOCAL_DOMAINS: sitosis.com,dotplan.online
SENDMAIL: /usr/bin/msmtp
SENDMAIL_ARGS: -C,/opt/data/msmtprc
ENABLE_EXPERIMENTAL_FEATURES: 1
ports:
- "127.0.0.1:4227:4227"
volumes:
- ./data:/opt/data
restart: unless-stopped

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
use local::lib;
use utf8;
use strict;
use warnings;