Web application built with docker (1)

I am developing a web application based on docker. I did a little bit of building the development base, so I summarized it in the article. It's a rudimentary thing, but is it your memorandum? I will write an article as a feeling.

Docker images nginx First, fetch nginx docker images.

$ docker pull docker.io/nginx
Using default tag: latest
latest: Pulling from library/nginx
bf5952930446: Already exists 
cb9a6de05e5a: Pull complete 
9513ea0afb93: Pull complete 
b49ea07d2e93: Pull complete 
a5e4a503d449: Pull complete 
Digest: sha256:b0ad43f7ee5edbc0effbc14645ae7055e21bc1973aee5150745632a24a752661
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest

Get it at! Check with docker images.

$ docker images
REPOSITORY                             TAG                 IMAGE ID            CREATED             SIZE
nginx                                  alpine              ecd67fe340f9        2 months ago        21.6MB

I'm going to docker run!

Note: Some of the following operations are incorrect. (There is a mistake in the command that docker runs.) </ Font> images⇨container I will continue to do.

Docker run is required to create a container. Let's go.

$ docker run -d -p 8000:80 --name cesium_nginx -v /Folder to mount:/home ecd67fe340f9 
a115c1e7a815a4856b2b51755e217f2cc1aa856c81489d9ae3020f4fefd0883f

This time, we will not only set up the port but also mount it. Options used -p Port number accessed from the outside: Specify the port number on the container side. -d Run in the background. -v Mount folder: Mount destination Mount the folder. -v local: cotainer --name Decide on a container name.

$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                  NAMES
a115c1e7a815        ecd67fe340f9        "/docker-entrypoint.…"   5 seconds ago       Up 4 seconds        0.0.0.0:8000->80/tcp   cesium_nginx

Go to localhost: 8000

http://localhost:8000/ When you open ...

スクリーンショット 2020-09-09 18.17.36.png

This is ... what is this ...

This is proof that nginx worked normally! !! !! In other words, success? I wondered, but I already have an html file in my mounted folder. So if you don't see it, you're not successful.

Fix

What was wrong ... In short, the mount was wrong. I mounted it on / home. The reason is appropriate ... I thought it was good everywhere.

It wasn't that sweet ...

docker rm and docker stop. (I will omit the processing there)

$ docker run --name cesium_nginx -v /Folder to mount:/usr/share/nginx/html:ro -d -p 8081:80 ecd67fe340f9 
f85c35793c4bb7368af7798db788f707bcbd4278bbcfdf87a360f727e6433c00

/ usr / share / nginx / html: ro This was needed.

Now let's open localhost: 8081!

スクリーンショット 2020-09-09 18.25.10.png

Kita ---

Finally the target screen is ... (This screen is the screen of a web application called Cesium.js. I have added some arrangements ...)

Summary

Is it a specification? Let's do it after checking it carefully

Start from here! I will play around with it. The beginning of fun and fun development ~ (As you can see, it was already under development ...)

Recommended Posts

Web application built with docker (1)
Web application creation with Nodejs with Docker
Deploy a Docker application with Greengrass
Build a web application with Javalin
Create a simple web application with Dropwizard
Start web application development with Spring Boot
Deploy your application with VPC + EC2 + Docker.
Run WEB application with Spring Boot + Thymeleaf
Create a java web application development environment with docker for mac part2
Launch MariaDB with Docker
Run Pico with docker
Explode Docker with WSL2
Use Puphpeteer with Docker
Operate Emby with Docker
Try WildFly with Docker
Use ngrok with Docker
Web application test automation
Run Payara with Docker
[Docker] Connection with MySQL
Php settings with Docker
Getting Started with Docker
Disposable PHP with Docker
Install Composer with Docker
[Tutorial] Download Eclipse → Run Web application with Java (Pleiades)
Display ROS application on Docker with GUI on host side
Roughly the flow of web application development with Rails.
Pytorch execution environment with Docker
Use GDAL with Python with Docker
Deploy with EC2 / Docker / Laravel
Run TAO Core with Docker
Web application development memo with MVN, Tomcat, JSP / Servlet with VScode
Set up GitLab with docker
The first WEB application with Spring Boot-Making a Pomodoro timer-
[Spring Boot] Web application creation
Web application development article summary
Java web application development environment construction with VS Code (struts2)
Run Rails whenever with docker
Get started with DynamoDB with docker
Docker autostart settings with wsl2
[Docker] Rails 5.2 environment construction with docker
Rails application development environment construction with Docker [Docker, Rails, Puma, Nginx, MySQL]
Version control CocoaPods with Docker
Try developing a containerized Java web application with Eclipse + Codewind
Time is wrong with the application launched on the Docker container
Easy web scraping with Jsoup
I tried BIND with Docker
Java: Start WAS with Docker and deploy your own application
React environment construction with Docker
Rails web server and application server
Build DynamoDB local with Docker
[Docker] Use whenever with Docker + Rails
Using PlantUml with Honkit [Docker]
Comparison of WEB application development with Rails and Java Servlet + JSP
Let's make a book management web application with Spring Boot part3
Procedure for building a Rails application development environment with Docker [Rails, MySQL, Docker]
Let's make a book management web application with Spring Boot part2
[Probably the easiest] WEB application development with Apache Tomcat + Java Servlet
[MySQL] The database server built with docker may not support Japanese ...
Create a Vue3 environment with Docker!
Node.js environment construction with Docker Compose
Run lambda with custom docker image