Sun Asterisk Developer
Note tạm vào đây từ từ viết chi tiết sau
Dockerfile
123456789101112131415
FROM ruby:2.7.1RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \ && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && apt-key update \ && apt-get update -qq \ && apt-get install -y --no-install-recommends build-essential libpq-dev nodejs yarn less \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/*WORKDIR /appCOPY Gemfile* ./CMD ["/app/docker_bash.sh"]
docker-compose.yml
1234567891011121314151617181920212223242526
version: "3"services: api: build: . volumes: - .:/app - bundle:/usr/local/bundle ports: - 3000:3000 depends_on: - db tty: true stdin_open: true db: image: mysql:5.7 volumes: - mysql_data:/var/lib/mysql ports: - "3307:3306" environment: MYSQL_ROOT_PASSWORD: rootvolumes: mysql_data: bundle:
docker_bash.sh
12345
#!/bin/shrm -f tmp/pids/server.pidbundle install -j4 --retry 5bundle exec rails db:preparebundle exec rails s -b '0.0.0.0'