This repository contains the infrastructure setup for fcloud.
Set up Terraform configuration:
cp terraform.tfvars.example terraform.tfvars
nano terraform.tfvars
# Set backend config
cp backend.tfvars.example backend.tfvars
nano backend.tfvars
Initialize Terraform:
terraform init -backend-config=backend.tfvars
Synchronize infrastructure:
terraform apply
To set up the Minecraft server, run:
terraform apply -var minecraft=true -target=module.minecraft
To tear down the Minecraft server, run:
terraform apply -var minecraft=false -target=module.minecraft
Setup a remote Docker context:
docker context create cloud --docker host=ssh://cloud@cloud.dejonckhee.re
docker context use cloud
Configure Docker Compose:
cp .env.example .env
nano .env
Configure applications:
for CONFIG in *.env.example; do cp -i${CONFIG} ${CONFIG//.example}; nano ${CONFIG//.example}; done
Deploy applications:
docker-compose up -d
Copy NGINX configuration to remote host:
docker-compose exec -T nginx tee /config/nginx/nginx.conf < nginx.conf
docker-compose exec nginx nginx -s reload
Copy dashboard configuration to remote host:
docker-compose --context cloud cp dashboard.yml dashboard:/www/assets/config.yml