200321
important point The situation where it doesn't work for some reason may be due to the AWS security group settings.
The procedure to set up EC2 is not explained here. One thing to keep in mind is the security group settings, which by default block everything except SSH.
sudo yum update
sudo yum install -y docker
You can check if the installation was successful. The version seems to be 1.21.5.
docker info
sudo service docker start
sudo usermod -a -G docker ec2-user
docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
Permission change required 'sudo chmod +x /usr/local/bin/docker-compose' 'docker-compose --version'
There is no need to create a directory structure on AWS. If you do such a thing, it will take time and effort and mistakes will occur repeatedly. It is correct to put Docker in the local development environment and copy the completed one as it is.
It is a setting that only SSH can be done just by setting up an EC2 instance normally. Please note that if you do not set the security group to pass the HTTP protocol (port 80 or 8000), you will never be able to connect and it will take time.
Zip the django project that has been confirmed to work in the local environment, and transfer it to the host. If you unzip it in the place you want to place it, the file will be created as it is, so docker-comopose up will start it.
end
Recommended Posts