From 4402677704777e90be887402ba33696ba8b15087 Mon Sep 17 00:00:00 2001 From: Ari Timonen Date: Sun, 8 Dec 2019 02:19:36 +0200 Subject: [PATCH] Add dev dockerfiles --- Dockerfile.dev | 25 +++++++++++++++++++++++++ docker-compose.dev.yml | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 Dockerfile.dev create mode 100644 docker-compose.dev.yml diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..c216b6b --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,25 @@ +FROM ruby:2.2.10 + +ENV RAILS_ENV development + +# Add 'web' user which will run the application +RUN adduser web --home /home/web --shell /bin/bash --disabled-password --gecos "" + +RUN apt-get update && apt-get -y upgrade \ + && apt-get -y install mysql-client libmysqlclient-dev memcached nodejs firefox-esr \ + && service memcached start + +# Separate Gemfile ADD so that `bundle install` can be cached more effectively + +ADD Gemfile Gemfile.lock /var/www/ + +RUN mkdir -p /var/bundle && chown -R web:web /var/bundle && chown -R web:web /var/www +RUN su -c "bundle config github.https true; cd /var/www && bundle install --path /var/bundle --jobs 4" -s /bin/bash -l web + +WORKDIR /var/www +USER web + +RUN bundle config github.https true; cd /var/www && bundle install --path /var/bundle --jobs 4 + +USER root +CMD ["/var/www/script/entry.sh"] diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..eb3886c --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,37 @@ +version: "3" + +services: + web: + build: + context: ./ + dockerfile: Dockerfile.dev + args: + buildno: 1 + volumes: + - ".:/var/www/" + ports: + - "4000:4000" + links: + - db + - memcached + # - redis + db: + # Debug + # command: bash + #tty: true + command: mysqld_safe --skip-grant-tables + image: mariadb:latest + volumes: + - "./db_data:/var/lib/mysql" + - "./ext/mysql.conf.d:/etc/mysql/conf.d" + environment: + - MYSQL_DATABASE=ensl + - MYSQL_USER=ensl + - MYSQL_USERNAME=ensl + - MYSQL_PASSWORD=ensl + - MYSQL_ROOT_PASSWORD=ensl + - MYSQL_ROOT_HOST=% + memcached: + image: memcached:latest + #redis: + # image: redis