diff --git a/migration/Dockerfile b/migration/Dockerfile
new file mode 100644
index 000000000..600115063
--- /dev/null
+++ b/migration/Dockerfile
@@ -0,0 +1,19 @@
+# Use the official Ruby image from Docker Hub
+FROM ruby:latest
+
+# Set the working directory inside the container
+WORKDIR /usr/src/app
+
+# Copy the Ruby script into the container
+COPY app.rb .
+
+# Install the webrick gem
+RUN gem install webrick
+RUN gem install mysql2
+
+# Expose port 8080 to be accessible from outside the container
+EXPOSE 8080
+
+# Define the command to run the script
+CMD ["ruby", "app.rb"]
+
diff --git a/migration/app.rb b/migration/app.rb
new file mode 100644
index 000000000..352896c51
--- /dev/null
+++ b/migration/app.rb
@@ -0,0 +1,37 @@
+require 'webrick'
+require 'mysql2'
+
+# Configure the MySQL client
+client = Mysql2::Client.new(
+ host: 'db', # Docker Compose service name
+ username: 'root',
+ password: 'password',
+ database: 'mydatabase'
+)
+
+# Define the web server
+server = WEBrick::HTTPServer.new(Port: 8080)
+
+# Define a response for the root path "/"
+server.mount_proc '/' do |req, res|
+ # Query the database
+ results = client.query('SELECT * FROM mytable')
+
+ # Build the HTML response
+ html = '
Data from MySQL
'
+ results.each do |row|
+ html += "- #{row['name']}
"
+ end
+ html += '
'
+
+ res.body = html
+end
+
+# Trap interrupts (Ctrl+C) to gracefully shut down the server
+trap 'INT' do
+ server.shutdown
+end
+
+# Start the server
+server.start
+
diff --git a/migration/docker-compose.yml b/migration/docker-compose.yml
new file mode 100644
index 000000000..fc1bb5a87
--- /dev/null
+++ b/migration/docker-compose.yml
@@ -0,0 +1,23 @@
+
+services:
+ db: # The name of your service
+ image: mysql/mysql-server:latest # The image to use
+ environment: # Environment variables
+ - MYSQL_ROOT_HOST=%
+ - MYSQL_ROOT_PASSWORD=password
+ ports:
+ - "3306:3306" # Port mapping
+ container_name: db # Name of the container
+ restart: unless-stopped # Restart policy
+ volumes:
+ - ./sql-data:/docker-entrypoint-initdb.d # Mount the initialization directory
+
+ app:
+ depends_on:
+ - db
+ build:
+ context: .
+ dockerfile: Dockerfile
+ ports:
+ - "8080:8080" # Map port 8080 of the container to port 8080 on the host
+ container_name: ruby-hello-world
diff --git a/migration/sql-data/init.sql b/migration/sql-data/init.sql
new file mode 100644
index 000000000..956063b4f
--- /dev/null
+++ b/migration/sql-data/init.sql
@@ -0,0 +1,10 @@
+CREATE DATABASE IF NOT EXISTS mydatabase;
+USE mydatabase;
+
+CREATE TABLE IF NOT EXISTS mytable (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ name VARCHAR(255) NOT NULL
+);
+
+INSERT INTO mytable (name) VALUES ('Hello, World!');
+