From 71e6d70521654394f8d15d5d049942fce8c03148 Mon Sep 17 00:00:00 2001 From: Rudis Muiznieks Date: Tue, 19 Jul 2022 07:53:14 -0500 Subject: [PATCH] added docker-compose and quick run details --- .gitignore | 6 +++++- Dockerfile | 5 +++++ README.md | 18 ++++++++++++++++++ data/msmtprc.example | 8 ++++++++ data/plans/.gitkeep | 0 docker-compose.yaml | 16 ++++++++++++++++ server.pl | 1 - 7 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 data/msmtprc.example create mode 100644 data/plans/.gitkeep create mode 100644 docker-compose.yaml diff --git a/.gitignore b/.gitignore index 6445f60..d644a64 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ -data/* +data/cache/* +data/dotplan.log +data/dotplan.pid +data/msmtprc test/data/* .env +.pls_cache/* diff --git a/Dockerfile b/Dockerfile index ba50273..f5779a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index da3e888..c6ce3b8 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/data/msmtprc.example b/data/msmtprc.example new file mode 100644 index 0000000..f5203f9 --- /dev/null +++ b/data/msmtprc.example @@ -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 diff --git a/data/plans/.gitkeep b/data/plans/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..9e8e5ab --- /dev/null +++ b/docker-compose.yaml @@ -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 diff --git a/server.pl b/server.pl index f17e7e4..a9f711b 100644 --- a/server.pl +++ b/server.pl @@ -1,6 +1,5 @@ #!/usr/bin/env perl -use local::lib; use utf8; use strict; use warnings;