This repo describes and helps build my webserver.
-
ubuntu (although other linux distributions should work)
-
docker
-
apache22-utils
-
static ip
-
port forwarded port 80
-
port forwarded port 443
-
domain name specified in the swarm files
-
DNS records pointing to the static ip
This repo includes multiple swarm-compose files that can be used to start up the different services in swarm mode.
Before starting, make sure that all secrets defined in the swarm files are created.
printf "value" | sudo docker secret create secret_name -
The traefik password needs to be generated:
htpasswd -c -s userfile admin
sudo docker secret create traefik_users userfile
The server can be setup by running the following command:
make setup
First, to set up the registry, this will be used to build local images like databases.
make build:registry
After the registry is set up, the images can be built and pushed:
make build:images
This will run all dockerfiles in the setup
directory and push them to the registry.
Next, the network can be set up:
make setup:network
After the images are built and pushed, the stack can be initialized:
make build:stack
Now that everything is set up, we can deploy the stack:
make deploy
Services can be updated using the following command:
make update service=service_name image=image_name version=version