-compose versionDocker-compose version 1.14.0-rc2, build 24dae73Docker-py version:2.3.0CPython version:2.7.13OpenSSL Version:openssl 1.0.1t 3 May 2016You can see that there are no more problems.0x2. Reason:Use the methods described in the official documentation:curl -L https://github.com/docker/compose/releases/downloa
/compose/releases/download/1.17.1/docker-compose-' uname -S '-' uname-m '-o/usr/local/bin/docker-composesudo chmod +x/usr/local/bin/docker-compose(the latest version can be from here https://github.com/
option) Example: docker-Compose up starts the service in the dependent order, in the following example, when the redis and DB services start the Web service by default using docker-Compose up Web to start the web service, the redis and DB services are also started, because the dependency version: '3' services: Web: Bu
: -Service_Name -Container_name Environment Add environment variables, you can use an array or a dictionary, only one key environment variable can find the corresponding value on the machine running compose, which helps the value of the encrypted or special host Environment: Rack_env:development Session_secret: Environments: -Rack_env=development -Session_secret Env_file Add an environment variable from a file If a template file is specified by
container, the service communication in a set of compose needs to be accessed using the name of the services.Spring Boot Project RetrofitIn the app directory that is pom.xm , and file siblings Dockerfile to add files, the file content is as follows:FROM maven:3.5-jdk-8There is only one sentence that relies on the underlying image maven3.5 and jdk 1.8 . Because the docker-compose.yaml project Start command
a subnet, with proxy server to achieve traffic redirection. In this case , you need to customize the DNS rules to match the server hostname to the intranet IP one by one. through Docker, Alpine and the Unbound Quickly create micro DNS ServerDocker After the advent of this e
the container through the data volume.
Practice
This set of services I have already encapsulated, usually use only clone down direct use, I here mainly talk about the realization of ideas.
Project Address: https://github.com/rootrl/php ...
My project directory structure:
php-environment-with-docker/├──bin│├──composer│├──getcontainerip│└──php├──conf│├──nginx││└──conf.d││└──nginx.conf│└──redis│└──redis.conf├──docke
Brief introduction:Docker can run a configured server on a single command, which is handy.But there is also a problem is that when the parameters are more, the mapping directory is more, map port more ...I used to write a script, start with a foot, very low ah.Also see some of the Docker Image introduction page has introduced Docker-
only one sentence that relies on the underlying image maven3.5 and jdk 1.8 . Because the docker-compose.yaml project Start command is set in the file, there is no need to add the start command.resourcesCreate application-dev.properties and application-docker.properties file in the project directory
application-dev.propertiesThe configuration information in is consistent with the above
application-docker.propertiesThe configuration inform
Tags: always folder ges latest command put PWD general execInformation:
Docker version ( $ docker --version ): Docker version 18.03.1-ce, version 9ee9f40
System Information: WINDOWS10 Professional Edition
MySQL is mounted in Docker's volume 1. The first step: 1 Docker volume create Mysql-data 2. S
complete, we can run the docker images view resultsWrite appThe first step is to create a simple app.rb fileThe second part, enter the following coderequire‘sinatra‘set‘0.0.0.0‘get‘/‘do ‘Hello world!‘endOne notable point here is that you need to set the server to bind to the 0.0.0.0 address, otherwise the container will not be accessible outside.New start.sh FileThis file is primarily used to start the We
# Dependencies between services to control the service startup sequence. Normally, the service is started in order.
Depends_on
# Custom DNS server, which can be a single value or list
DNS
# Override entrypoin
Entrypoint
# Add an environment variable from a file, which can be a single value or a list
Env_file
# Add environment variables, which can be arrays or di
Use docker-compose to build the AspNetCore development environment,
Use docker-compose to build the AspNetCore Development Environment
1. Use docker-compose to build a Development Environment
Our goal is simple: Use
responsible for monitoring 8080 ports, Nginx received dynamic Web pages need to be handled by Tomcat, to be forwarded to 8080 ports. In the Docker environment, the Nginx directly forwards the request to 8080,tomcat is not forwarded. So with Llinks, the value here is T1, which is the name.In the nginx.conf file, add the following configuration:On the HTTP side, addUpstream Backend {#后台负载均衡容器及端口, this example is the name of a T1 tomcat containerServer
commandsudo chown-r $USER: $USER. Third, connect the databaseIn this section, we will create the database and connect the Django3.1 In your project directory, edit the composeexample/settings.py file 3.2 to databases = ... Replace with the following:DATABASES = {' default ': { ' ENGINE ': ' Django.db.backends.postgresql ', ' NAME ': ' Postgres ', ' USER ': ' Postgres ', ' HOST ': ' db ', ' PORT ': 5432, }}3.3 Run the command under your project's root di
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.