diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..7703347a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# Use the official Ruby 3.2 image as a base image +ARG RUBY_VERSION=3.2 +FROM ruby:${RUBY_VERSION}-bullseye + +# Set the working directory +WORKDIR /usr/src/app + +# Install system packages +RUN apt-get update -qq && \ + apt-get install -y default-mysql-client postgresql postgresql-contrib vim && \ + apt-get clean + +# Copy all files +COPY . . + +RUN bundler config set --local without "db2 oracle sqlserver sqlite postgresql" +# Move sample database.yml and install gems +RUN mv test/connections/databases.example.yml test/connections/databases.yml && \ + bundle install + +CMD ["irb"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..a8ab0f57 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,26 @@ +version: "3.5" + +services: + mysql: + platform: linux/x86_64 + image: mysql:5.7 + volumes: + - mysql-data:/var/lib/mysql + ports: + - "3306:3306" + environment: + - MYSQL_ROOT_PASSWORD=root + + app: + build: + context: . + environment: + DB_HOST: mysql + volumes: + - .:/usr/src/app + depends_on: + - mysql + command: tail -f /dev/null + +volumes: + mysql-data: