capsul-flask/capsulflask
3wordchant 72c04d8495 Docker image, & local development docker-compose.yml (#2)
Adds:
- a Docker image, which can be used in both development and production
- a `docker-compose.yml` file for local development (could probably be adapted for production deployments)

Testing:
- `git checkout docker`
- `docker-compose up`
- pray 🙏
- go to http://localhost:5000

## App architecture

I added the ability to load secret config variables (`HUB_TOKEN`, `STRIPE_SECRET_KEY` etc) from files, to support [Docker Secrets](https://docs.docker.com/engine/swarm/secrets/) natively. The code should probably log an error if a specified `HUB_TOKEN_FILE` doesn't exist instead of failing silently..

## Docker architecture

This uses a multi-stage build to reduce the size of the final image -- having pipenv install to a predefined virtualenv, and then copying that over.

The compose file doesn't include a definition for a cron runner service, and I haven't tested running one yet. Here be dragons!

You can rebuild the image locally using `docker-compose build`, but this isn't required for changes to the app code, only if you edit the `Dockerfile`, or want to publish your image for use on a swarm server (in which case you will need to edit the image name to put in your own Docker hub credentials).

Currently, the image is rebuilt (should set up auto-tagging..) and published with every push to this 3wordchant/capsul-flask fork.

Reviewed-on: 3wordchant/capsul-flask#2
Co-authored-by: 3wordchant <3wordchant@noreply.git.autonomic.zone>
Co-committed-by: 3wordchant <3wordchant@noreply.git.autonomic.zone>
2021-07-22 01:18:10 +02:00
..
btcpay remove broken unneeded code from bitpay 2020-05-15 18:26:41 -05:00
schema_migrations add public_ipv4_first_usable_ip, public_ipv4_last_usable_ip 2021-07-12 14:38:56 -05:00
shell_scripts use the provided network_name when creating a capsul 2021-07-12 12:19:56 -05:00
static Add custom themes, THEME setting, basic "yolocolo" theme (#7) 2021-07-22 01:15:39 +02:00
templates Merge pull request 'Disable BTCPay in the interface, if BTCPAY_PRIVATE_KEY is un-set' (#3) from optional-btcpay into master 2021-07-21 20:20:40 +02:00
theme/yolocolo Add custom themes, THEME setting, basic "yolocolo" theme (#7) 2021-07-22 01:15:39 +02:00
__init__.py Docker image, & local development docker-compose.yml (#2) 2021-07-22 01:18:10 +02:00
admin.py add public_ipv4_first_usable_ip, public_ipv4_last_usable_ip 2021-07-12 14:38:56 -05:00
auth.py finishing touches and fixes on managed IPs database migration 16 2021-07-09 14:35:23 -05:00
cli.py fix defaults for running locally and make email server not required. 2021-07-07 13:47:21 -05:00
console.py correctly enforce affordable_vm_sizes post form submission 2021-07-21 16:45:53 -05:00
db_model.py add public_ipv4_first_usable_ip, public_ipv4_last_usable_ip 2021-07-12 14:38:56 -05:00
db.py add public_ipv4_first_usable_ip, public_ipv4_last_usable_ip 2021-07-12 14:38:56 -05:00
http_client.py missed a spot 2021-02-15 23:52:52 -06:00
hub_api.py move hardcoding public3 to the right place 2021-07-12 16:10:28 -05:00
hub_model.py Add VMs to the database even with HUB_MODE=mock (#6) 2021-07-21 23:26:10 +02:00
landing.py Auto-generate the pricing table from the database 2021-07-21 12:19:28 +02:00
metrics.py first crack at adding ssh host key display to the capsul detail page 2021-01-30 01:39:48 -06:00
payment.py define BTCPAY_ENABLED based on URL and btcpay key, pass it explicitly 2021-07-21 12:12:41 -05:00
shared.py first try at implementing the vm start and stop feature 2021-02-17 20:50:17 -06:00
spoke_api.py fixing capsul creation after I broke it with the pre-allocated IP 2021-07-11 12:18:58 -05:00
spoke_model.py fixing capsul creation after I broke it with the pre-allocated IP 2021-07-11 12:18:58 -05:00