docker-compose

Docker Compose: How to specify path to docker file while building as if in different directory?

徘徊边缘 提交于 2021-01-27 07:14:04
问题 docker build -t test2 -f tests/low_conviction_integration/Dockerfile . If I need to copy a file from a directory ABOVE my Dockerfile, I can accomplish it by calling docker build -t image_name -f path_to_docker_file/Dockerfile . from that ABOVE directory How can I accomplish the same behavior with docker-compose? I want docker-compose to exist in same directory as Dockerfile, to build with Dockerfile, but to ultimately call it as if it was in ABOVE directory, so that I can copy the correct

Why isn't my docker-entrypoint-initdb.d script (as specified in docker-compose.yml) executed to initialize a fresh MySQL instance?

和自甴很熟 提交于 2021-01-27 06:33:31
问题 I found out about the /docker-entrypoint-initdb.d directory from this answer, and also read the "Initializing a fresh instance" section of the "How to use this image" MySQL documentation. But when I run docker-compose up in the directory containing the docker-compose.yml file below, my database isn't initialized. services: # Use root/root as MySQL user/password credentials db: image: mysql restart: always environment: MYSQL_ROOT_PASSWORD: root MYSQL_USER: root MYSQL_PASSWORD: root MYSQL

How can I specify the container runtime to use in docker-compose version 3?

断了今生、忘了曾经 提交于 2021-01-27 06:06:25
问题 I'm working on a container that requires the nvidia runtime. I can specify this runtime in a v2.3 docker-compose file like so: version: "2.3" services: my-service: image: "my-image" runtime: "nvidia" ... Running docker-compose up my-service works just fine. I get the nvidia runtime and everything works fine. I've tried this just by changing the "2.3" to "3" and I get the following error when I do docker-compose up my-service : ERROR: The Compose file './docker-compose.yml' is invalid because:

How can I specify the container runtime to use in docker-compose version 3?

旧时模样 提交于 2021-01-27 06:05:31
问题 I'm working on a container that requires the nvidia runtime. I can specify this runtime in a v2.3 docker-compose file like so: version: "2.3" services: my-service: image: "my-image" runtime: "nvidia" ... Running docker-compose up my-service works just fine. I get the nvidia runtime and everything works fine. I've tried this just by changing the "2.3" to "3" and I get the following error when I do docker-compose up my-service : ERROR: The Compose file './docker-compose.yml' is invalid because:

How can I specify the container runtime to use in docker-compose version 3?

六眼飞鱼酱① 提交于 2021-01-27 06:05:06
问题 I'm working on a container that requires the nvidia runtime. I can specify this runtime in a v2.3 docker-compose file like so: version: "2.3" services: my-service: image: "my-image" runtime: "nvidia" ... Running docker-compose up my-service works just fine. I get the nvidia runtime and everything works fine. I've tried this just by changing the "2.3" to "3" and I get the following error when I do docker-compose up my-service : ERROR: The Compose file './docker-compose.yml' is invalid because:

Sharing /tmp between two containers

半世苍凉 提交于 2021-01-27 04:42:46
问题 I'm using docker-compose to spawn two containers. I would like to share the /tmp directory between these two containers (but not with the host /tmp if possible). This is because I'm uploading some files through flask to /tmp and want to process these files from celery . flask: build: . command: "gulp" ports: - '3000:3000' - '5000:5000' links: - celery - redis volumes: - .:/usr/src/app:rw celery: build: . command: "celery -A web.tasks worker --autoreload --loglevel=info" environment: - C_FORCE

connect to mysql container from another container

依然范特西╮ 提交于 2021-01-27 04:22:10
问题 I'm trying to connect to a mysql container from within another container on the same network specified by a compose file. version: "2" services: web: build: context: . dockerfile: nginx/Dockerfile ports: - "8080:80" volumes: - ./data:/srv php: build: context: . dockerfile: php-fpm/Dockerfile volumes: - ./data:/srv mysql: image: mysql environment: - MYSQL_ALLOW_EMPTY_PASSWORD=yes - MYSQL_USER=dummy_user - MYSQL_PASSWORD=12345 I'm not really sure what the connection parameters would be if I'm

Docker NGINX Proxy not Forwarding Websockets

≡放荡痞女 提交于 2021-01-26 23:50:08
问题 NGINX proxy is passing HTTP GET requests instead of WebSocket handshakes to my django application. Facts: Rest of the non-websocket proxying to django app is working great. I can get WebSockets to work if I connect to the django application container directly. (Relevant log entries below.) The nginx configuration works localhost on my development machine (no containerizing). (Log example below.) Relevant Logs: Daphne log when connecting through containerized nginx proxy: `xxx.xxx.xxx.xxx

Get server URL in django docker

柔情痞子 提交于 2021-01-25 07:18:45
问题 I am running Django project in docker. I have 3 docker container. For Django App For Postgres For Nginx My docker-compose.yml file is as follow version: "3" services: db: restart: always container_name: tts-db image: postgres:9.6 environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres - POSTGRES_DB=tts expose: - "5432" nginx: image: nginx:latest container_name: tts-nginx ports: - "8000:8000" volumes: - ./nginx/site-enabled:/etc/nginx/conf.d depends_on: - web web: build: . container

docker-compose picks the wrong ruby version

百般思念 提交于 2021-01-24 07:09:34
问题 When running docker-compose, it seems to pick the wrong ruby program. Using rbenv I have installed version 2.6.2 But there is also a version under /usr/bin that is at 2.6.3. I can't delete that version, also not as sudo. I have already uninstalled rbenv and re-installed it. The strange thing is this: MBP-Andre:biblestudy_platform andreheijstek$ which ruby /Users/andreheijstek/.rbenv/shims/ruby MBP-Andre:biblestudy_platform andreheijstek$ whereis ruby /usr/bin/ruby When I run docker-compose,