Browse Source

Somewhat works but is missing RubyMine integration

Ticket #610 @3h
960
Martin Bober 6 years ago
parent
commit
7a72b2d490
  1. 3
      .dockerignore
  2. 32
      Readme.md
  3. 16
      config/database.yml
  4. 17
      docker-compose.yml
  5. 4
      docker/db/db.env
  6. 3
      docker/db/docker-entrypoint-initdb.d/01-init_development.sql
  7. 3
      docker/db/docker-entrypoint-initdb.d/02-init_test.sql

3
.dockerignore

@ -1 +1,2 @@
.git/
.git/
log/*

32
Readme.md

@ -20,4 +20,34 @@ To start docker on system start
sudo systemctl enable docker
[1]: https://docs.docker.com/engine/installation/linux/ubuntulinux/
[1]: https://docs.docker.com/engine/installation/linux/ubuntulinux/
## Access docker as normal user
sudo groupadd docker
sudo gpasswd -a martin docker
## Install docker-compose
Go to the [latest docker-compose release](https://github.com/docker/compose/releases/latest) and execute the script commands given there. Example:
curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
## Docker integration in RubyMine
[Official Guide][2]
### Install the official docker Plugin
File -> Settings -> Plugins -> Install JetBrains Plugin
### Create a docker configuration for localhost
File -> Settings -> Build, Execution, Deployment -> Docker
* API url: unix:///var/run/docker.sock
[2]: https://www.jetbrains.com/help/ruby/2016.1/docker.html

16
config/database.yml

@ -5,25 +5,25 @@
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
adapter: mysql2
username: charxchange
password: charxchange
host: db
encoding: utf8
development:
<<: *default
database: db/development.sqlite3
database: charxchange_development
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
database: charxchange_test
production:
adapter: mysql2
database: charxchange
username: charxchange
password: <%= ENV["RAILS_PROD_DB_PASSWD"] %>
host: localhost
encoding: utf8
password: <%= ENV["RAILS_PROD_DB_PASSWD"] %>

17
docker-compose.yml

@ -0,0 +1,17 @@
db:
image: library/mysql:5.7.16
volumes:
- ./docker/db/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
ports:
- "13306:3306"
env_file:
- ./docker/db/db.env
web:
build: .
volumes:
- .:/myapp
ports:
- "3000:3000"
links:
- db

4
docker/db/db.env

@ -0,0 +1,4 @@
MYSQL_ROOT_PASSWORD=charxchange
MYSQL_DATABASE=charxchange
MYSQL_USER=charxchange
MYSQL_PASSWORD=charxchange

3
docker/db/docker-entrypoint-initdb.d/01-init_development.sql

@ -0,0 +1,3 @@
CREATE DATABASE charxchange_development;
GRANT ALL PRIVILEGES ON charxchange_development.* TO 'charxchange';
FLUSH PRIVILEGES;

3
docker/db/docker-entrypoint-initdb.d/02-init_test.sql

@ -0,0 +1,3 @@
CREATE DATABASE charxchange_test;
GRANT ALL PRIVILEGES on charxchange_test.* TO 'charxchange';
FLUSH PRIVILEGES;
Loading…
Cancel
Save