version: "2" services: app: build: . ports: - "3000:3000" links: - db environment: - RAILS_ENV=production - RAILS_SERVE_STATIC_FILES=true - RAILS_LOG_TO_STDOUT=true - DATABASE_URL=postgresql://postgres@db/spectre - DATABASE_USERNAME= - POSTGRES_PASSWORD=somepassword - DOMAIN_NAME=app - PORT=:3000 - PROTOCOL=http:// volumes: - .:/app command: bash -c "rm -f /app/tmp/pids/*.pid && rake assets:precompile && SECRET_KEY_BASE=`rake secret` rails server -p 3000" db: image: postgres:9.6 ports: - "5432" volumes: - .:/app - .:/public - data-db:/var/lib/postgresql/data environment: - POSTGRES_DB=spectre - POSTGRES_PASSWORD=somepassword volumes: data-db: {}