This is a sample project used to demonstrate automating Docker deployments. The accompanying tutorial is at https://maximorlov.com/automate-your-docker-deployments/.
Interesting files to look at are .circleci/config.yml
and deploy.sh
.
-
Clone the repo
git clone [email protected]:Maximization/autodeploy-docker.git && cd autodeploy-docker
-
Start the server
npm start
-
Visit
localhost:3000
in your browser
The following environment variables are used in the deployment pipeline:
DOCKER_USERNAME
- Docker Hub username
DOCKER_PASSWORD
- Docker Hub password
SSH_KEY
- Base64 encoded private SSH key that has access to the deployment server
SERVER_PUBLIC_KEY
- Base64 encoded public SSH key of the deployment server
SERVER_IP
- Deployment server IP address
docker build --rm -t autodeploy-docker .
docker run --rm --init -d --name autodeploy-docker -p 3000:3000 autodeploy-docker
docker system prune -af