On Github jwo / docker-next-big-thing
mysqldata: image: cogniteev/echo volumes: - /var/lib/mysql db: build: mysql:latest expose: - "3306" volumes_from: - mysqldata app: build: . command: bundle exec rails s -p 3000 -b '0.0.0.0' volumes: - .:/myapp ports: - "3000:3000" links: - db
Have to have it so your Macs can run Linux in your Linux
(Like Postgres, etc Data)
mysqldata: image: cogniteev/echo volumes: - /var/lib/mysql db: build: mysql:latest expose: - "3306" volumes_from: - mysqldata
docker-compose run app rake db:migrate
Add in a .env file like you normally would. Gitignore it.
mysql: env_file: DockerConfig/.env volumes_from: - mysqldatacontainer
production: adapter: mysql2 database: yolo_production username: <%= ENV['MYSQL_USER']%> password: <%= ENV['MYSQL_PASS']%> host: mysql port: 3306
docker-compose run app /bin/bash
Prometheus, by SoundCloud folk, rules.
prometheus: build: docker_config/prometheus ports: - "9090:9090" links: - containerexporter containerexporter: image: prom/container-exporter ports: - "9104:9104" volumes: - /sys/fs/cgroup:/cgroup - /var/run/docker.sock:/var/run/docker.sock
FROM phusion/passenger-ruby22 RUN apt-get update -qq && apt-get install -y build-essential RUN mkdir /myapp WORKDIR /myapp ADD . /myapp RUN bundle install
(assuming you want to say, run Inspeqtor to notify you of crashes)
# Add runit startups RUN mkdir /etc/sv/inspeqtor ADD inspeqtor.runit /etc/sv/inspeqtor/run RUN mkdir /etc/sv/mysql ADD mysql.runit /etc/sv/mysql/run RUN chmod +x /etc/sv/inspeqtor/run RUN chmod +x /etc/sv/mysql/run # Link runit startup scripts RUN ln -s /etc/sv/mysql/ /etc/service/mysql RUN ln -s /etc/sv/inspeqtor/ /etc/service/inspeqtor # remove the upstart config directory RUN rm -rf /etc/init
Images are on https://registry.hub.docker.com/
Ubuntu. CoreOS. Debian. (likely more).
What if I told you that using other people's (even official) docker images lead to more problems than they solve?
— Jesse Wolgamott (@jwo) April 27, 2015upstream app_servers { server 127.0.0.1:8080; server 127.0.0.1:8081; }
Possible way to automate: http://jasonwilder.com/blog/2014/03/25/automated-nginx-reverse-proxy-for-docker/
boot2docker destroy boot2docker init --disksize=20000
(Yeah, that deletes all stuff and you start over)
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 555b3b4e31fa fivehundred_app:latest "bundle exec rails s 2 minutes ago Up 2 minutes 80/tcp, 443/tcp fivehundred_app_1 6a5bb766f745 postgres:latest "/docker-entrypoint. 2 minutes ago Up 2 minutes 5432/tcp fivehundred_db_1
docker kill 555b3b4e31fa