-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDeployment-Documentation
71 lines (47 loc) · 2.46 KB
/
Deployment-Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Note: Make sure you have the root access you start working with prerequisite setup and running docker-compose files.
Prerequisite setup and command to run docker-compose file:
1. Docker
Docker must be installed on the remote host to run containers.
Installation Steps for Docker on a Linux Host:
Update the package database:
sudo apt-get update
Install the required dependencies:
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
Add Docker's official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Add Docker's official APT repository:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Update the package database again:
sudo apt-get update
Install Docker CE (Community Edition):
sudo apt-get install docker-ce
Verify Docker installation:
sudo docker --version
Enable Docker to start on boot:
sudo systemctl enable docker
sudo systemctl start docker
2. Docker Compose
Docker Compose is a tool to define and manage multi-container Docker applications using a docker-compose.yml file.
Installation Steps for Docker Compose on a Linux Host:
Download the latest version of Docker Compose:
sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r .tag_name)/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Set the proper permissions to allow execution:
sudo chmod +x /usr/local/bin/docker-compose
Verify Docker Compose installation:
docker-compose --version
Note: If the command jq is not installed, you can install it using:
sudo apt-get install jq
3. (Optional) Install Python (if not already installed)
Ansible requires Python to be installed on the remote machine to execute tasks. Most modern Linux distributions come with Python pre-installed, but if it’s not available, you can install it using:
sudo apt-get install python3
4. Ensure Proper Permissions
If you're running Docker with sudo, make sure your user is part of the docker group to avoid having to use sudo for every Docker command:
sudo usermod -aG docker $USER
Then, log out and back in, or run:
newgrp docker
5. Run the Docker Compose File
Once Docker and Docker Compose are installed, you can navigate to the directory containing your docker-compose.yml file and run the following commands:
To start your services:
docker-compose up -d
To stop the services:
docker-compose down