I have an ancient (like 2012) Ruby on Rails server that uses MySql2 database. The server, of course, is not made by me so I now have to find out how even launch it. And I want to use Docker for that.
I found this guide to setup Docker container for Rails and PostgreSQL database. So, what do I have to change here to run it with MySql2?
Here is my RoR server's database setup:
adapter: mysql2
encoding: utf8
database: g_development
pool: 5
username: notactualusername
password: notactualpassword
This is a line from Dockerfile in the tutorial that installs and updates all the stuff
RUN apt-get update -qq && apt-get install -y nodejs postgresql-client
I need to change postgresql to mysql2, right?
This is from tutorial docker-compose
db:
image: postgres
volumes:
- ./tmp/db:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: password
So, is MySql2 image just called mysql2? Is the password variable called MYSQL2_PASSWORD or something else?
This is also from tutorial (initialization):
docker compose run --no-deps web rails new . --force --database=postgresql
I guess changing here postgresql to mysql2? Do I actually need to run rails new .
since I already have a server built?