[RUBY] Create RUNTEQ's environment with Windows DockerDesktop

Separated mysql / rails container

docker-compose.yaml

version: '3'
services: 
  db:
    container_name: mysql
    image: mysql:8.0.21
    command: --default-authentication-plugin=mysql_native_password 
    environment:  
      MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
      MYSQL_DATABASE: root
      TZ: 'Asia/Tokyo'
    ports:
      - "3306:3306"
    tty:  true
  ruby:
    container_name: ruby
    build: .
    volumes:
      - ".:/runteq:cached"
      # 1. exclude volumes
      - /runteq/vendor
      - /runteq/node_modules
      - /runteq/tmp
      - /runteq/log
      - /runteq/.git
    ports:
      - 3000:3000
    tty:  true

Dockerfile

FROM ruby:2.6.4
ADD . /runteq
WORKDIR /runteq
SHELL ["/bin/bash", "-c"]
ENTRYPOINT [ "/bin/bash" ]
EXPOSE 3000

# WORKING USER
ARG DOCKER_UID=1000
ARG DOCKER_USER=runteq
ARG DOCKER_PASSWORD=runteq
RUN useradd -m --uid ${DOCKER_UID} --groups sudo ${DOCKER_USER} && echo ${DOCKER_USER}:${DOCKER_PASSWORD} | chpasswd
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
ENV DEBCONF_NOWARNINGS=yes

# INIT
RUN apt-get -y update
RUN apt-get install -y apt-utils 
RUN apt-get install -y build-essential
RUN apt-get install -y git-core 
RUN apt-get install -y vim

# bundler
RUN apt-get install -y bundler
RUN gem install bundler:2.1.4

# YARN
RUN apt-get -y remove cmdtest
RUN apt-get -y remove yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update 
RUN apt-get -y install yarn

# rbenv
RUN apt-get remove rbenv
RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv
RUN echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
RUN source ~/.bashrc
RUN ~/.rbenv/bin/rbenv init -
RUN echo 'eval "$(rbenv init -)"' >> ~/.bashrc
RUN mkdir -p ~/.rbenv/plugins
RUN git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
# RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash

# nodeenv
RUN apt-get remove nodeenv
RUN git clone https://github.com/OiNutter/nodenv /usr/local/nodenv
RUN echo 'export NODENV_ROOT=/usr/local/nodenv' >> ~/.bashrc
RUN echo 'export PATH=$NODENV_ROOT/bin:$PATH' >> ~/.bashrc
RUN source ~/.bashrc
RUN echo 'eval "$(nodenv init -)"'  >> ~/.bashrc
RUN mkdir -p /usr/local/nodenv/plugins
RUN git clone https://github.com/OiNutter/node-build /usr/local/nodenv/plugins/node-build

# Google chrome
RUN /bin/bash -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
RUN curl -sS https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN apt-get -y update
RUN apt-get install -y google-chrome-stable

# sqlite3
RUN apt-get install -y sqlite3

# ETC
RUN git config --global credential.helper store 

Recommended Posts

Create RUNTEQ's environment with Windows DockerDesktop
[Windows] [IntelliJ] [Java] [Tomcat] Create a Tomcat9 environment with IntelliJ
Create Spring Boot environment with Windows + VS Code
Create Chisel development environment with Windows10 + WSL2 + VScode + Docker
Create a Vue3 environment with Docker!
Let's create Ubuntu environment with vmware
Create SolrCloud verification environment with Docker
Create Laravel environment with Docker (docker-compose)
Create Rails 6 + MySQL environment with Docker compose
Create a MySQL environment with Docker from 0-> 1
Create Spring Boot-gradle-mysql development environment with Docker
[Docker] Create Node.js + express + webpack environment with Docker
[Memo] Create a CentOS 8 environment easily with Docker
Self-hosting with Docker of AuteMuteUs in Windows environment
Create ubuntu20.04 (or windows10) + anaconda + pytorch or tensorflow environment
Create a Spring Boot development environment with docker
Penronse environment construction [Windows]
Try create with Trailblazer
Build ruby debug environment with VS Code of Windows 10
Create an E2E test environment with Docker x Cypress
Windows10 + WSL2 + DockerDesktop + docker-compose + GPU (Nvidia) + Jupyterlab environment construction
[Note] Create a java environment from scratch with docker
Create an environment where CircleCI can be executed locally with Windows10 + WSL2 (Ubuntu) + Docker
Beginners create Spring Tools Suite environment with VS Code
Deploying a Java environment with Windows Subsystem for Linux (WSL)
I tried to create a java8 development environment with Chocolatey
Create Rails5 and postgresql environment with Docker and make pgadmin available
I tried to create a padrino development environment with Docker
Zip compression with Java in Windows environment without garbled characters
Pytorch execution environment with Docker
[Docker] Create Elasticsearch, Kibana environment!
Create a playground with Xcode 12
Prepare Python3 environment with CentOS7
[Docker] Rails 5.2 environment construction with docker
Build docker environment with WSL
Ruby ① Build a Windows environment
Create microservices with Spring Boot
Exciting environment check with mkmf
React environment construction with Docker
[SAP] Create a development environment with NW AS ABAP Developer Edition (1)
Building a haskell environment with Docker + VS Code on Windows 10 Home
Look through Java and MySQL PATH with environment variables [Windows version]