-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matt Gosden
committed
May 3, 2020
1 parent
d72d6e3
commit a1a6513
Showing
5 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
CONTAINERROLE=all | ||
DBPREFIX=postgresql+psycopg2:// | ||
DBNAME=docassemble | ||
DBUSER=docassemble | ||
DBPASSWORD=abc123 # Update this | ||
DBHOST=null | ||
USEHTTPS=true | ||
DAHOSTNAME=domain.example.com # Update this | ||
USELETSENCRYPT=true | ||
LETSENCRYPTEMAIL=[email protected] # Update this | ||
S3ENABLE=false # Set to true if using DigitalOcean Spaces | ||
S3ACCESSKEY= # Set to Spaces access token if using Spaces | ||
S3SECRETACCESSKEY= # Set to Spaces access secret if using Spaces | ||
S3ENDPOINTURL= # Set to the Spaces URL | ||
S3BUCKET= # Set to Spaces name if using Spaces | ||
S3REGION= # Leave blank | ||
EC2=false | ||
TIMEZONE=America/New_York | ||
DAPYTHONVERSION=3 | ||
COLLECTSTATISTICS=true | ||
SERVERADMIN= | ||
POSTURLROOT=/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## Deploying docassemble to DigitalOcean | ||
|
||
[DigitalOcean](https://www.digitalocean.com/) is a popular web hosting alternative to AWS and Azure. It is a cost-effective solution for hosting docassemble apps. | ||
|
||
For deployment, DigitalOcean [virtual machines with docker pre-installed](https://marketplace.digitalocean.com/apps/docker) can be spun up quickly and docassemble installed there. | ||
|
||
[DigitalOcean Spaces](https://www.digitalocean.com/products/spaces/) are available to store the backups and configuration files. These are S3 compatible and therefore the setup is very similar to the AWS S3 instructions. | ||
|
||
This setup uses both a new Droplet and Spaces. | ||
|
||
### Deploy a DigitalOcean Droplet (VM) with docker installed | ||
|
||
From your DigitalOcean account dashboard, click to set up a new Droplet (this is the DigitalOcean name for a 'virtual machine'). | ||
|
||
In the options, go to the Marketplace tab and search for the [docker image](https://marketplace.digitalocean.com/apps/docker). This will spin up a new virtual machine with docker already installed. | ||
|
||
A USD 10 per month droplet will usually be sufficient to get started on docassemble. | ||
|
||
### Set up a new DigitalOcean Space (S3 compatible) | ||
|
||
From the DigitalOcean account dashboard, create a new 'Space' and an access token. DigitalOcean provides a [step-by-step guide](https://www.digitalocean.com/community/tutorials/how-to-create-a-digitalocean-space-and-api-key) for these steps. | ||
|
||
Note the URL for this new Space, and the access token as you will need for configuration later. | ||
|
||
### Configure docassemble | ||
|
||
When deploying docassemble on this new droplet, point the S3 configuration to the DigitalOcean Space you set up. | ||
|
||
The URL from your new DigitalOcean Space (e.g. https://spacename.fra1.digitaloceanspaces.com) maps to the `S3` configuration options as follows: | ||
|
||
- `S3ENDPOINTURL=https://fra1.digitaloceanspaces.com` | ||
- `S3REGION=` (leave this blank) | ||
- `S3BUCKET=spacename` | ||
|
||
Set the `S3ACCESSKEY` and `S3SECRETACCESSKEY` parameters to the access token values, and set `S3ENABLED=true`. | ||
|
||
Your S3 configuration should now be complete. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# DigitalOcean single server setup | ||
|
||
[DigitalOcean](https://www.digitalocean.com/) is a popular web hosting alternative to AWS and Azure. It is a cost-effective solution for hosting docassemble apps. | ||
|
||
For deployment, DigitalOcean [virtual machines (called 'Droplets') with docker pre-installed](https://marketplace.digitalocean.com/apps/docker) can be spun up quickly and docassemble installed there. | ||
|
||
[DigitalOcean Spaces](https://www.digitalocean.com/products/spaces/) are available to store the backups and configuration files. These are S3 compatible and therefore the setup is very similar to the AWS S3 instructions. | ||
|
||
This setup uses both a new Droplet and Spaces. | ||
|
||
The app is secured using LetsEncrypt SSL certificates. | ||
|
||
## Getting started | ||
|
||
1. This assumes you have already set up: | ||
|
||
- a new DigitalOcean Droplet with docker running - can be done with [one click](https://marketplace.digitalocean.com/apps/docker). A USD 10 per month droplet will usually be sufficient to get started with docassemble. | ||
|
||
- a new DigitalOcean Space (i.e. 'S3 bucket') to store the data and an access token - [step-by-step instructions](https://www.digitalocean.com/community/tutorials/how-to-create-a-digitalocean-space-and-api-key) | ||
|
||
1. Log into your Droplet and copy across the `.env` and `docker-compose.yml` file into a new project directory. | ||
|
||
1. Edit the `.env` file to add the settings for for your setup. As a minimum, make sure you set | ||
|
||
- `DAHOSTNAME` to the **domain name** | ||
- `LETSENCRYPTEMAIL` to your valid email for LetsEncrypt to use. | ||
|
||
1. Edit the `.env` file to add the configuration for the S3 compatible DigitalOcean Space: | ||
|
||
- `S3ENABLE=true` | ||
- `S3ENDPOINTURL=https://fra1.digitaloceanspaces.com` - or similar for other regions than `fra1` | ||
- `S3BUCKET=spaces_name` - putting in the name of your Space | ||
- `S3ACCESSKEY=yourkey` - from the access token | ||
- `S3SECRETACCESSKEY=yoursecret` - from the access token | ||
|
||
1. Before starting up **docassemble** ensure you have a DNS record for the **domain name** pointing correctly to the **IP address** of the server. Without this, LetsEncrypt may fail to create a valid certificate for you. | ||
|
||
1. Run using: | ||
|
||
docker-compose up -d | ||
|
||
## Notes | ||
|
||
- In `docker-compose.yml` the **restart** option is set to `always` so that it will attempt to restart if the container goes down. | ||
|
||
- For other settings, see the [official documentation on configuration options](https://docassemble.org/docs/docker.html#configuration%20options). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: "3" | ||
services: | ||
docassemble: | ||
image: jhpyle/docassemble:latest | ||
container_name: docassemble-prod | ||
env_file: | ||
- .env | ||
restart: always | ||
stop_grace_period: 6m | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
volumes: | ||
- dabackup:/usr/share/docassemble/backup | ||
|
||
volumes: | ||
dabackup: | ||
driver: local |