docker-compose

PHP cannot write in docker container

♀尐吖头ヾ 提交于 2020-01-02 09:30:30
问题 I'm trying to create a workflow in docker. It's simple: just PHP and MySQL to little tests. My docker-compose.yml : web: build: .docker links: - mysql:mysql ports: - "80:80" - "443:443" volumes: - ./public_html:/var/www/html mysql: image: mysql:5.7 environment: - MYSQL_ROOT_PASSWORD=root volumes: - "./.data/db:/var/lib/mysql" phpmyadmin: image: phpmyadmin/phpmyadmin ports: - "8080:80" links: - mysql:mysql environment: - PMA_HOST=mysql volumes: - /sessions And my Dockerfile : FROM php:5.6

PHP cannot write in docker container

半腔热情 提交于 2020-01-02 09:30:07
问题 I'm trying to create a workflow in docker. It's simple: just PHP and MySQL to little tests. My docker-compose.yml : web: build: .docker links: - mysql:mysql ports: - "80:80" - "443:443" volumes: - ./public_html:/var/www/html mysql: image: mysql:5.7 environment: - MYSQL_ROOT_PASSWORD=root volumes: - "./.data/db:/var/lib/mysql" phpmyadmin: image: phpmyadmin/phpmyadmin ports: - "8080:80" links: - mysql:mysql environment: - PMA_HOST=mysql volumes: - /sessions And my Dockerfile : FROM php:5.6

Docker Compose + Postgres: Expose port

随声附和 提交于 2020-01-02 06:18:56
问题 I am currently trying to use Docker for my new Django/Postgres project. I am working on a Mac and usually use Postico to quickly connect to my database. I used to connect like here: I used the official Docker documentation to setup docker-compose. I now have the issue, that I can't connect via Postico to the postgres db. It seems to me that the problem comes from the ports not being exposed. version: '3' services: db: image: postgres web: build: . command: python3 manage.py runserver 0.0.0.0

Can I Run a dotnet app which is hosted on IIS in a docker container?

北战南征 提交于 2020-01-02 05:59:15
问题 I have developed a web application using asp dotnet and currently I have it running on IIS is there anyway I can run the same app in a docker container, I am relatively new to Docker and I have played around a bit and I am familiar with docker compose , so I was wondering if I can (dockerize) the application that I have developed. My Dockerfile now looks like: #Making a dotnet container FROM microsoft/dotnet:latest #Make a directory WORKDIR /app #copy dll files and other dependencies COPY .

Volume changes not persistent after “docker-compose run” command (Django's collectstatic)

戏子无情 提交于 2020-01-02 05:33:07
问题 I have a Django environment that I create with Docker Compose, and I'm trying to use manage.py collectstatic to copy my site's static files to a directory in the container. This directory (/usr/src/app/static) is also a Docker Volume. After building my docker containers ( docker-compose build ), I run docker-compose run web python manage.py collectstatic , which works as expected, but my web server (Nginx) is not finding the files, nor are there any files when I run docker-compose run web ls

php cannot connect to mysql in docker-compose

笑着哭i 提交于 2020-01-02 05:32:10
问题 Here is my docker-compose version: '2' services: nginx: image: nginx:1.11.8-alpine ports: - "8081:80" volumes: - ./code:/usr/share/nginx/html - ./html:/myapp - ./site.conf:/etc/nginx/conf.d/site.conf - ./default.conf:/etc/nginx/conf.d/default.conf - ./error.log:/var/log/nginx/error.log - ./nginx.conf:/etc/nginx/nginx.conf links: - phpfpm phpfpm: image: php7-fpm:latest ports: - "9000:9000" volumes: - ./code:/usr/share/nginx/html links: - db_mysql db_mysql: image: mysql:5.7.17 volumes: - db

Docker Compose Nested Environment Variable

房东的猫 提交于 2020-01-02 05:01:08
问题 I have an existing app that uses a app config file that looks like: "ConnectionInfo": { "ServerName": "The Server URL", "DatabaseName": "The DatabaseName", "UserName": "The User Name", "Password": "The Password"} Now, when I have a simple setting, say "ConnectionString":"My Connection String" I understand how to override it in the compose.yml file: environment: - ConnectionString=what I want it to be The question is, how do you set, say, the server name in the top? 回答1: Please use underscore

docker compose oci runtime error, executable file not found in $PATH

主宰稳场 提交于 2020-01-02 04:50:09
问题 I'm following this post: http://eric-price.net/blog/centralized-logging-docker-aws-elasticsearch This is what my docker-compose.yml looks like : version: "2" services: fluentd: image: fluent/fluentd:latest ports: - "24224:24224" command: start.sh networks: - lognet nginx: image: nginx-pixel ports: - "80:80" logging: driver: fluentd networks: - lognet networks: lognet: driver: bridge my start.sh is in the same directory as the yml file. When I run docker-compose up -d this is what I get :

In docker-compose how to create an alias / link to localhost?

半世苍凉 提交于 2020-01-02 02:19:05
问题 In my docker-compose file there is a need for several containers to know the hostname of a specific container, including this specific container. Links will not work, since a container can not link to itself. Basically, what I am looking for is a way to alias localhost in docker-compose. 回答1: You should avoid using links. Instead, services on the same Docker network can find each other by using service names as DNS names. Use that to reference the specific container you described, including

yaml.parser.ParserError: while parsing a block mapping

夙愿已清 提交于 2020-01-02 01:20:49
问题 ERROR: yaml.parser.ParserError: while parsing a block mapping in "././tmp/statelesscs_compose.yml", line 1, column 1 expected <block end>, but found ':' in "././tmp/statelesscs_compose.yml", line 4, column 1 docbase installation completed while executing the below yml file.can you please suggest me how to resolve this. Example usage: docker-compose -f my.yml up also let me know is there any tool for formatting yml file so that i can easily modify my.yml: version: '2' services: