This Terraform module provisions 1 OCI instance using Oracle Cloud's Always Free services: https://www.oracle.com/cloud/free/. By default, the resources will be created in the us-ashburn-1 region.
The repo also contains a series of Ansible playbooks to help automate configuring:
- A FoundryVTT installation via Docker (felddy/foundryvtt),
- reverse proxied via nginx with ModSecurity + CRS,
- with container image updates via Watchtower
- Valid Let's Encrypt/certbot SSL certificates for HTTPS
- and a free DDNS address via DuckDNS.
- An Oracle Cloud Free Tier account
- A valid license key for FoundryVTT
- Ansible
- Terraform/OpenTofu
- Please see veriables.tf for an explanation of all variables used in the templates.
- terraform.tfvars.dist contains a file with some defaults for an example.
- To get your tenancy OCID, see: https://docs.cloud.oracle.com/en-us/iaas/Content/General/Concepts/identifiers.htm
- To get your API key and other authentication information, see: https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm
terraform init
cp terraform.tfvars.dist terraform.tfvars # and fill it with your own data
terraform plan
terraform apply
- After creating the infrastructure, you will now have a new OCI instance and some files will have been generated, including an Ansible inventory with the instance's IP address.
- Go to the ansible folder with:
cd ansible
- Install required Ansible packages with:
ansible-galaxy install -r requirements.yml
- Install Docker:
ansible-playbook -i inventory install-docker.yml
- Configure the host_vars
cp host_vars/fvtt-instance-1.yml.dist host_vars/fvtt-instance-1.yml
- Modify the file with your email, DuckDNS domain, and DuckDNS API key
- Set any environment variables for Foundry. See felddy/foundryvtt-docker for more details on configuration and options.
- Configure certificates with Certbot and DuckDNS:
ansible-playbook -i inventory certbot.yml
- Install and start Foundry:
ansible-playbook -i inventory foundry.yml
- (Optional) Enable unattended-upgrades (for APT):
ansible-playbook -i inventory unattended-upgrades.yml
The docker-compose.yml is generated by the Ansible playbook.
You should make any changes to the environment variables in the list and rerun the playbook with:
ansible-playbook -i inventory foundry.yml
This will also automatically restart your Foundry instance.