Skip to content

Instantly share code, notes, and snippets.

@ogawatti
Created August 23, 2022 22:49
Show Gist options
  • Save ogawatti/7f3415c65598a794a5a38bfb42306b84 to your computer and use it in GitHub Desktop.
Save ogawatti/7f3415c65598a794a5a38bfb42306b84 to your computer and use it in GitHub Desktop.
rails and db, swagger, redoc for docker
version: '3'
services:
app:
build: .
volumes:
- ./:/usr/src/app
ports:
- "3000:3000"
depends_on:
- db
stdin_open: true
tty: true
command: bundle exec rails server -b 0.0.0.0
environment:
DB_USERNAME: root
DB_PASSWORD: passwd
DB_HOST: db
OPENAPI: 1
RUBYOPT: '--disable-did_you_mean'
db:
image: mysql:8.0-oracle
environment:
MYSQL_DATABASE: db_development
MYSQL_ROOT_PASSWORD: passwd
TZ: 'Asia/Tokyo'
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --innodb_use_native_aio=0
ports:
- '3306:3306'
expose:
- '3306'
swagger-ui:
image: pentusha/swagger-ui-crossbuild
volumes:
- ./doc:/usr/share/nginx/html/doc
environment:
API_URL: doc/openapi.yaml
ports:
- "9001:8080"
redoc:
image: redocly/redoc
ports:
- "9002:80"
volumes:
- ./doc/openapi.yaml:/usr/share/nginx/html/swagger.yaml
environment:
- SPEC_URL=swagger.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment