From 86d098b74d8b4efc4580a932ad2511110eef7d45 Mon Sep 17 00:00:00 2001 From: Ari Timonen Date: Sat, 21 Mar 2020 22:32:48 +0200 Subject: [PATCH] Update Dockerfile + docs --- DEVELOPMENT.md | 7 +++++++ Dockerfile | 2 +- INSTALL.md | 8 +++----- docker-compose.dev.yml | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index d6e554d..99e2c6c 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -2,6 +2,13 @@ Install instructions in INSTALL.md +1. Everything should be running on containers. +1. If you need to run stuff on your host (eg. ruby, rubocop, bundle install etc) run all commands from the: `Dockerfile.dev`. It should setup identical setup for your machine. +1. Add docker container names to /etc/hosts. This makes it possible to run test from local machine without using the container since editor/IDE don't integrate with Docker so well. + + sudo echo `docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ensl_dev_db` db >> /etc/hosts +1. To run VS Code plugin Ruby Test Explorer in docker container you need to create path to custom + This is just random tips for development. Not a full documentation. # Handy commands diff --git a/Dockerfile b/Dockerfile index f9bc3d6..84ad636 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.4.9 +FROM ruby:2.5.7 ENV RAILS_ENV production diff --git a/INSTALL.md b/INSTALL.md index c4fc082..8c9a47a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -2,7 +2,7 @@ ENSL Website is fairly easy to run. -## 1. Install docker and docker-compose +## 1. Install requirements: docker, docker-compose and git https://docs.docker.com/install/ https://docs.docker.com/compose/install/ @@ -12,9 +12,7 @@ Install docker + docker-compose: wget -O - 'https://get.docker.com/'|bash sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose -## 2. Install git - -https://git-scm.com/book/en/v2/Getting-Started-Installing-Git +Install git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git sudo apt-get install nginx @@ -36,7 +34,7 @@ Finally, Start the docker containers. docker-compose build docker-compose --rm up -## 4. Install reverse proxy +## 4. Install reverse proxy (production only) Install apache, nginx etc. reverse proxy. It will take requests from the users and pass them to ENSL website. Sample configuration availble @ ext/nginx. diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index fad24b1..2947a9e 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -83,6 +83,7 @@ services: #tty: true command: mysqld_safe --skip-grant-tables image: mariadb:latest + container_name: ensl_dev_db volumes: - "./db_data:/var/lib/mysql" - "./ext/mysql.conf.d:/etc/mysql/conf.d"