一度 build する。
$ docker-compose up --build
起動したら CTRL+C で停止。
マイグレーション。
$ docker-compose run rails bin/rails db:migrate
もう一度起動。
$ docker-compose up
docker ps で rails が EXPOSE しているポートを見て Web ブラウザでアクセスしてみる。
http://localhost:xxxxx
一度 build する。
$ docker-compose up --build
起動したら CTRL+C で停止。
マイグレーション。
$ docker-compose run rails bin/rails db:migrate
もう一度起動。
$ docker-compose up
docker ps で rails が EXPOSE しているポートを見て Web ブラウザでアクセスしてみる。
http://localhost:xxxxx
| postgres: | |
| image: postgres:9.5.3 | |
| environment: | |
| POSTGRES_USER: kawaiichan | |
| POSTGRES_PASSWORD: passwordxxx | |
| volumes: | |
| - kawaiichan-postgres:/var/lib/postgresql/data | |
| redis: | |
| image: redis:3.2.1 | |
| volumes: | |
| - kawaiichan-redis:/var/lib/redis/data | |
| rails: | |
| build: . | |
| links: | |
| - postgres | |
| - redis | |
| volumes: | |
| - .:/kawaiichan | |
| ports: | |
| - '3000' | |
| env_file: | |
| - secrets.env |
| FROM ruby:2.3.1 | |
| MAINTAINER Hirofumi Wakasugi <baenej@gmail.com> | |
| RUN apt-get update && apt-get install -qq -y build-essential nodejs --fix-missing --no-install-recommends | |
| ENV INSTALL_PATH /kawaiichan | |
| RUN mkdir $INSTALL_PATH | |
| WORKDIR $INSTALL_PATH | |
| COPY Gemfile Gemfile | |
| COPY Gemfile.lock Gemfile.lock | |
| RUN bundle install --without developmet test --jobs 4 | |
| COPY . . | |
| CMD bundle exec puma -C config/puma.rb |
| SECRET_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
| DATABASE_URL=postgresql://kawaiichan:passwordxxx@postgres:5432/kawaiichan?encoding=utf8&pool=5&timeout=5000 | |
| REDIS_URL=redis://redis.local:6379 |