docker-compose

NGINX Container Routing: Nginx does not redirect to docker containers

百般思念 提交于 2019-12-24 06:37:19
问题 I am new in web-servers. I am setting up a server (example.de) serving two different dockerized applications. The exposed ports 3000 (app1) and 5000 (app2) are mapped in server ports 9000 and 9001 respectively. Requesting the urls example.de:9000 and example.de:9001, the content is properly load. Now, I want to use a NGINX container as reverse proxy to redirect the urls example.de/app1, and example.de/app2. "include /etc/nginx/mime.types;" is set by default in the nginx.conf file. The default

Connect tomcat and mysql in docker-compose

ぐ巨炮叔叔 提交于 2019-12-24 05:38:27
问题 I'm working on project for studies. Now I am at the stage of moving project to docker containers. I have placet tomcat with my website and mysql with database do docker-compose.yml. Unfortunately classes from tomcat can't connect with database Java code import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class Waliduj { String url="jdbc:mysql://localhost:3306/uczelnia?useTimezone=true

Docker variable expansion in compose entrypoint

十年热恋 提交于 2019-12-24 04:33:04
问题 I've found that if I override an image's ENTRYPOINT in a docker-compose service entry, that it ignore variables defined in the environment section but will read them from an env file, e.g. someserver: image: "some-server:latest" restart: always ports: - "8849:8849" environment: javaMemoryLimit: 3056M JAVA_OPTS: "-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=8849 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun

Composer not working in docker container: “https://packagist.org/packages.json” does not contain valid JSON

徘徊边缘 提交于 2019-12-24 02:55:09
问题 I have a docker container that's running a Symfony application (which works fine). Composer install/require commands (e.g. composer require annotations ) inside the container often fail with the following error: [Seld\JsonLint\ParsingException] "https://packagist.org/packages.json" does not contain valid JSON Parse error on line 1: \\\\\\u��n[7 ��� ^ Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[' I haven't really been able to find a pattern on when the commands succeed

Can't perform API request from one docker image to another

隐身守侯 提交于 2019-12-24 02:54:08
问题 Im working on an application where I have a react frontend and a java spring backend. I have a simple API call where I want to return a new address. I have verified this works by using a separate container to perform a curl command docker container run --rm -it --net multichain-network byrnedo/alpine-curl http://multichain-api:8080/api/blockchain/address/create . This call returns the the expected result. Now I have created my docker environments using docker-compose and they are all up and

How to exit “docker run” containers once the script those containers execute calls exit()

你。 提交于 2019-12-24 02:17:10
问题 I have a docker-compose setup, which is deployed in three steps: Build all the containers and dc up -d ( dc is an alias for docker-compose ) Create database with: dc run web /usr/local/bin/python create_db.py Populate database with: dc run -d web /usr/local/bin/python -u manage.py populateDB Steps 2 and 3 create new containers (see the first two): ~/Documents/Project » docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2ead532ea58b myproject_web "/usr/local/bin/pytho" 8 minutes

docker-compose inside Alpine container

情到浓时终转凉″ 提交于 2019-12-24 01:29:11
问题 I'm attempting to bundle my app (code, Dockerfiles and a docker-compose script) together inside a single image for easy deployment (entrypoint will just docker-compose up ). My Dockerfile for this top level app image looks like so FROM alpine:latest COPY . /app RUN apk update && apk add --no-cache docker py-pip openrc && pip install docker-compose When I run this image, it seems that dockerd hasn't started, being absent from top results; docker ps reports "Cannot connect to the Docker daemon

Why httpd container exits immediately without any error in Docker

你说的曾经没有我的故事 提交于 2019-12-24 01:24:37
问题 I am new to Docker. My Dockerfile (got from a tutorial) is: FROM ubuntu ENV DEBIAN_FRONTEND noninteractive RUN apt-get update \ && apt-get install -y --no-install-recommends apache2 \ libapache2-mod-jk VOLUME ["/var/log/apache2"] RUN echo 'ServerName localhost' >> /etc/apache2/apache2.conf EXPOSE 80 443 ENTRYPOINT ["apache2ctl", "-D", "FOREGROUND"] I gave docker build -t mg:httpd apache\ . No errors. λ docker images REPOSITORY TAG IMAGE ID CREATED SIZE mg httpd 262d7a4f85fc About an hour ago

Link mysql to application in docker

我只是一个虾纸丫 提交于 2019-12-24 01:23:10
问题 Hi how would I connect a mysql container to another container so that my application in one of those container can use Mysql? Based on this reference I need to run this docker run --name some-app --link some-mysql:mysql -d application-that-uses-mysql But I have no idea what does some-app mean and the application-that-uses-mysql? does it mean the container ID that will use it? below is the list of the running container 回答1: --name some-app refers to the container name you want to assign to the

can't connect to redis through node app, both in dockers

こ雲淡風輕ζ 提交于 2019-12-24 01:15:09
问题 I'm trying to connect my app to redis, but i get: [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379 when i do: docker exec -it ed02b7e19810 ping test_redis_1 i've received all packets. also the redis container declares: * Running mode=standalone, port=6379 * Ready to accept connections ( i get the WARNINGS but i don't think its related: Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf