source .env_dev
Create .env_prod
, if it does not exist, setting all values defined in .env_dev
, then:
source .env_prod
Also, add a prod.yml
file to inventory
folder (with information about the production server), and a https://github.com/intk-prod.yml
to host_vars
folder.
Install Python 3 virtual environment and Ansible
cd devops
make clean
make setup
Edit the group_vars/users.yml
file and replace the line public_keys: [] with
public_keys:
- '<your ssh public key>'
As the images used in this deployment are public, just make sure you already are logged in with Docker.
After that, we need to create a new docker context, to be stored inside this folder.
make docker-setup
The shortcut is to run all steps at once with:
make all
This command provision a new machine, if running in the local environment, run the playbook and then deploy the stack.
Only valid for local deployments using Vagrant. This creates a new Vagrant box with the configuration according to the Vagrantfile
.
make provision
Setup the server, by installing base packages, creating UFW
configuration and adding users
make run-playbook
Run docker stack
to deploy to the server
make deploy
Use this also when there is a new version of any of the images.
make status
Tool | Command |
---|---|
webserver | make logs-webserver |
frontend | make logs-frontend |
backend | make logs-backend |