[RAILS] Let's finally use Docker: Start, stop, delete development environment

I was able to prepare the development environment last time Finally using Docker: Terminology, Image, Launch

In this article, start, stop, and delete the development environment Summarize the method

to start

Run on the directory where ** docker-compose.yml ** is located

docker-compose up -d 

If you start it without adding "-d" You can see the access log of the site, etc.

Stop

Stop the container with the following command

docker-compose stop

** The container itself exists ** just in the stopped state ** Execute this command to proceed with development as needed

delete

If you want to delete the entire command instead of stopping the command Execute the following command

docker-compose down

Even if you delete it, use the docker-compose up command The container is created and started again

Also, if you stop with Ctrl + C, you can see which process number Rails is running. The recorded file (** server.pid **) remains. I get an error the next time I start

error contents

Terminal


A server is already running. Check /app/tmp/servier.pid

If you do, delete tmp/pids/server.pid and restart You can restart with ** docker-compose up ** → I tried running it with Ctrl + C, but I was able to ** docker-compose up ** without any problems. For the time being, refer to the reference article as a memorandum

Reference article

https://www.udemy.com/course/rails-kj https://qiita.com/gold-kou/items/44860fbda1a34a001fc1 https://qiita.com/azul915/items/5b7063cbc80192343fc0

Recommended Posts

Let's finally use Docker: Start, stop, delete development environment
Let's finally use Docker: Terms, Images, Launch
WSL2 + VSCode + Docker development environment
Use MailHog for checking emails in the development environment (using Docker)
Until you build the docker environment and start / stop the Ubuntu container
Build Unity development environment on docker
[Docker] Use environment variables in Nginx conf
Laravel development environment construction with Docker (Mac)
Sapper × Go (echo) × Docker development environment construction
Build a PureScript development environment with Docker
[Docker] Building an environment to use Hugo
Use docker in proxy environment on ubuntu 20.04.1
Create Spring Boot-gradle-mysql development environment with Docker
Let's create a Java development environment (updating)
[Docker] Development environment construction Rails6 / Ruby2.7 / MySQL8
Spring Boot + Docker Java development environment construction
Build a Wordpress development environment with Docker
[Docker] Start container, start bash in container, delete image
Build an Ultra96v2 development environment on Docker 1
Note: [Docker] How to start and stop
Lightweight PHP 7.4 development environment created with Docker
Build a simple Docker + Django development environment
Build a development environment for Docker + Rails6 + Postgresql
Let's get started with Java-Create a development environment ②
Let's get started with Java-Create a development environment ①
Build a WordPress development environment quickly with Docker
Improve the performance of your Docker development environment
Build a simple Docker Compose + Django development environment
Command to stop or delete all Docker resources
iOS app development: Timer app (3. Start / Stop button, Reset button)
A reminder of Docker and development environment construction
Build a development environment for Docker, java, vscode
[First team development ②] Build an environment with Docker
Wordpress local environment construction & development procedure with Docker
Create a Spring Boot development environment with docker