docker-compose

Getting exit code out of docker-compose up

六月ゝ 毕业季﹏ 提交于 2020-05-09 06:36:09
问题 I have an issue getting an exit code out of docker-compose up . I have the simplest container that runs a script that always exits with 1: #!/usr/bin/env sh exit 1 My Dockerfile: FROM mhart/alpine-node:6 RUN mkdir /app WORKDIR /app And my docker-compose.yml: version: '2' services: test_container: container_name: test_container build: . volumes: - ${PWD}/run.sh:/app/run.sh entrypoint: ["/app/run.sh"] When I run it with docker-compose -f docker-compose.yml up --force-recreate test_container I

React app exiting in docker container with exit code 0

主宰稳场 提交于 2020-05-09 06:16:13
问题 I am trying to create a docker-compose setup with nginzx, flask, and react. I started my react app with react-create-app (https://github.com/facebook/create-react-app) and haven't changed anything from it yet. My Dockerfile for the react app is: FROM node:10 WORKDIR /usr/src/app # Install app dependencies # A wildcard is used to ensure both package.json AND package-lock.json are copied COPY package*.json ./ RUN npm install --verbose # Bundle app source COPY . . EXPOSE 3000 CMD ["npm", "start"

Communications link failure , Spring Boot + MySql +Docker + Hibernate

半世苍凉 提交于 2020-05-08 18:32:15
问题 I'm working with spring boot, hibernate & MySql. While running the application it is running well as per expectation . But while making the docker-compose file and running the app docker image with mysql docker image it gives this error. Error com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure java.net.ConnectException: Connection refused. private Connection createConnection() throws SQLException { DriverManager.registerDriver(new com.mysql.jdbc.Driver());

Communications link failure , Spring Boot + MySql +Docker + Hibernate

試著忘記壹切 提交于 2020-05-08 18:28:55
问题 I'm working with spring boot, hibernate & MySql. While running the application it is running well as per expectation . But while making the docker-compose file and running the app docker image with mysql docker image it gives this error. Error com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure java.net.ConnectException: Connection refused. private Connection createConnection() throws SQLException { DriverManager.registerDriver(new com.mysql.jdbc.Driver());

Can you define optional docker-compose services?

依然范特西╮ 提交于 2020-05-08 06:29:10
问题 Is there a way to define a Docker Compose service such that it is only brought up when you explicitly request it? That is to say: docker-compose up would not start it, but docker-compose up optional_service would. 回答1: One way to achieve that is to define your optional service in a different compose file. Then to start the optional service, run: $ docker-compose -f docker-compose.yml -f optional-service.yaml up For example, if I have a docker-compose.yml file that looks like: version: '2.1'

Can you define optional docker-compose services?

时光总嘲笑我的痴心妄想 提交于 2020-05-08 06:27:12
问题 Is there a way to define a Docker Compose service such that it is only brought up when you explicitly request it? That is to say: docker-compose up would not start it, but docker-compose up optional_service would. 回答1: One way to achieve that is to define your optional service in a different compose file. Then to start the optional service, run: $ docker-compose -f docker-compose.yml -f optional-service.yaml up For example, if I have a docker-compose.yml file that looks like: version: '2.1'

Django, Docker, and Pipenv - Error adding new packages

走远了吗. 提交于 2020-04-30 15:42:46
问题 Using Pipenv with Docker is causing some issues in my Django project. I've installed Django locally with Pipenv which generates a Pipfile and Pipfile.lock . Then used startproject to start a new Django project. Then I add a Dockerfile file. # Dockerfile FROM python:3.7-slim ENV PYTHONUNBUFFERED 1 WORKDIR /code COPY . /code RUN pip install pipenv RUN pipenv install --system And a docker-compose.yml file. # docker-compose.yml version: '3' services: web: build: . command: python /code/manage.py

Unsupported config option for services.db: 'images'

坚强是说给别人听的谎言 提交于 2020-04-30 11:43:22
问题 I am trying to learn how to utilize docker-compose and was following instructions until I received an error. Here's my docker-compose file. version: '3.7' services: web: build: ./app command: python /usr/src/app/manage.py runserver 0.0.0.0:8000 volumes: - ./app/:/usr/src/app/ ports: - 8000:8000 environment: - SECRET_KEY=my_secret_key - SQL_ENGINE=django.db.backends.postgresql - SQL_DATABASE=postgres - SQL_USER=postgres - SQL_PASSWORD=postgres - SQL_HOST=db - SQL_PORT=5432 depends_on: - db db:

Unsupported config option for services.db: 'images'

╄→гoц情女王★ 提交于 2020-04-30 11:41:56
问题 I am trying to learn how to utilize docker-compose and was following instructions until I received an error. Here's my docker-compose file. version: '3.7' services: web: build: ./app command: python /usr/src/app/manage.py runserver 0.0.0.0:8000 volumes: - ./app/:/usr/src/app/ ports: - 8000:8000 environment: - SECRET_KEY=my_secret_key - SQL_ENGINE=django.db.backends.postgresql - SQL_DATABASE=postgres - SQL_USER=postgres - SQL_PASSWORD=postgres - SQL_HOST=db - SQL_PORT=5432 depends_on: - db db:

Unsupported config option for services.db: 'images'

佐手、 提交于 2020-04-30 11:41:26
问题 I am trying to learn how to utilize docker-compose and was following instructions until I received an error. Here's my docker-compose file. version: '3.7' services: web: build: ./app command: python /usr/src/app/manage.py runserver 0.0.0.0:8000 volumes: - ./app/:/usr/src/app/ ports: - 8000:8000 environment: - SECRET_KEY=my_secret_key - SQL_ENGINE=django.db.backends.postgresql - SQL_DATABASE=postgres - SQL_USER=postgres - SQL_PASSWORD=postgres - SQL_HOST=db - SQL_PORT=5432 depends_on: - db db: