A quick and dirty post for a quick and dirty deployment!
I have a static photo portfolio website for my side business (studio.anthonythielen.com) that runs on one of my Linode servers. The time investment for a CICD deployment for a static photo portfolio that I change once a quarter far doesn't make a lot of sense to me. So... A simple docker compose file with a restart always configuration will do!
Create a Dockerfile starting with a nginx template (alpine variety for reduce size) and copy over websites root directory:
FROM nginx:alpine COPY --chown=nginx:nginx ./your-static-website-root /usr/share/nginx/html
Let's build that docker image:
$ docker build -t some-quick-drty-website:1.0.0 .
Now let's create a docker-compose.yml file:
version: '3.5' services: photo_website: container_name: some-quick-drty-website image: some-quick-drty-website:1.0.0 restart: always ports: - 8080:80
Finally bring that container up:
$ docker-compose up -d
Go hit http://localhost:8080.
Now what? Add a Nginx container to the docker-compose.yml for proxying or a volume to easily change website assets and reveal to the world!