0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rails5 + webpacker環境をVagrantで構築するときの設定ファイル

Posted at

Vagrantで構築する環境

  • OS: Ubuntu16.04
  • DB: mysql5.7

設定ファイル

Vagrantfile
Vagrant.configure("2") do |config|
  config.vm.box_url = "https://atlas.hashicorp.com/ubuntu/boxes/xenial64"
  config.vm.box = "ubuntu/xenial64"

  config.vm.network "forwarded_port", guest: 3000, host: 3000 // rails用
  config.vm.network "forwarded_port", guest: 8080, host: 8080 // webpack server用
  config.vm.network "private_network", ip: "192.168.33.10"

  # dockerでmysqlを構築
  config.vm.provision "docker" do |d|
    d.run "db",
          image: "library/mysql:5.7.18",
          args: "-p 3306:3306 -v /var/host_lib/mysql:/var/lib/mysql --name mysqld -e MYSQL_ROOT_PASSWORD=password -d"
  end
end
config/webpack/development.server.js
module.exports = merge(devConfig, {
  devServer: {
    host: "0.0.0.0",
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?