Skip to content

New Project With Django Nginx Postgres EC2

Matt Harley edited this page May 18, 2015 · 9 revisions

Tips

  • Don't forget to open the docker port on AWS EC2 and other PaaS!
  • Use an ssh tunnel to access the web interface:
ssh -i ../auth/docker-test.pem -L 4243:localhost:4243 [email protected]
  • Attach to a docker container and still be able to detach using CTRL+C
docker attach --sig-proxy=false NAME
  • Expose port 80 to the outside world:
docker run -p 80:80 ...
  • Delete old containers
docker ps -a | awk '{print $1}' | xargs docker rm
  • Running a command in an existing container (which is running). E.g. installing an elastic search plugin
docker exec 164a38e940dc /elasticsearch/bin/plugin -i elasticsearch/marvel/latest

Enable web interface

sudo vi /etc/default/docker

...
# Use DOCKER_OPTS to modify the daemon startup options.
DOCKER_OPTS="-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock --dns 8.8.8.8 --dns 8.8.4.4"
...

# Open the ufw firewall. See above for a better way of doing things with ssh!
sudo ufw allow 4243/tcp

References

Clone this wiki locally