$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bb27ea2a4484 nginx:alpine "nginx -g 'daemon of…" 15 seconds ago Exited (0) 5 seconds ago awesome_greider
a31a11ad3e12 nginx:alpine "nginx -g 'daemon of…" 16 seconds ago Exited (0) 9 seconds ago lucid_proskuriakova
1b10852465f7 nginx:alpine "nginx -g 'daemon of…" 19 seconds ago Up 18 seconds 80/tcp compassionate_knuth
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
$ docker run --rm -it ubuntu
# apt-get update && apt-get install -y curl
# sh -c 'read website; sleep 3; curl http://$website;'
curler.sh:
#!/bin/sh
read website; sleep 3; curl http://$website;
Dockerfile:
FROM ubuntu
RUN apt-get update && apt-get install -y curl
WORKDIR /app
COPY curler.sh ./
CMD ["/app/curler.sh"]
How to run:
docker build -t curler 104
docker run --rm -it curler
docker build -t devops-105 105
docker run --rm -p 5000:5000 devops-105
docker build -t devops-106 106
docker run --rm -p 8000:8000 -v (pwd)/logs.txt:/app/logs.txt devops-106
See exercises 1.5 and 1.6.
docker run --rm -v (pwd)/108/logs.txt:/usr/app/logs.txt devopsdockeruh/first_volume_exercise
docker run --rm -p 8080:80 devopsdockeruh/ports_exercise
docker build -t 111 .
docker run --rm -p 8000:8000 -v (pwd)/logs.txt:/app/logs.txt 111
Frontend Dockerfile Backend Dockerfile
Had to add SECRET_KEY_BASE
environment variable to get the server running. Precompiled assets are not loaded but I think this is due to configuration / having to setup nginx to serve the assets.
docker-compose up
docker-compose scale compute=3
docker-compose.yml nginx.conf Dockerfile frontend Dockerfile backend
Everything seems to be working already.