fig

When running a Django dev server with docker/fig, why is some of the log output hidden?

核能气质少年 提交于 2019-12-23 08:01:54
问题 I'm writing a Dockerfile which needs to run multiple commands as part of the CMD instruction and I thought the right way to do this would be to run a shell script with the main daemon executed via exec . Unfortunately, as part of that process some of my output (stdout? stderr? I don't know, and I don't know how to find out) gets lost. Here's the shell script: #!/bin/sh python manage.py migrate exec python manage.py runserver 0.0.0.0:8000 The idea being that the migrate command is just run

Cannot connect to docker mongo

↘锁芯ラ 提交于 2019-12-11 04:33:11
问题 I am setting up a project using sane with docker. After creating the project to use mongodb and createing a resource I tried running it, but got an error reporting that the server container could not connect to mongo. I then tried just running fig up to see if it was a fig problem and got the same error. Here is my fig.yml (irrelevant comments removed): db: image: mongo:latest ports: - "27017:27017" server: image: artificial/docker-sails:stable-pm2 command: sails lift volumes: - server/:

Docker mysql host not privileged

回眸只為那壹抹淺笑 提交于 2019-12-10 15:25:57
问题 I am trying to configure a nodejs container to connect to a mysql database. My code looks like this: var pool = mysql.createPool({ host : 'mysql', port : '3306', user : 'root', password : '...', database : 'general', connectionLimit : 50, queueLimit : 5000 }); I am using the standard mysql container. I am using fig for starting the containers. fig.yml looks something like: node: build: node ports: - "9000:9000" - "9001:9001" links: - mysql:mysql command: node server/Main.js mysql: image:

What is the proper way of setting a mongodb replica set using docker and fig?

橙三吉。 提交于 2019-12-10 13:00:17
问题 What is the proper way of setting a mongodb replica set using docker and fig? I was trying to follow official mongodb tutorials to create a fig.yml file with some replica sets but always got blocked by how to call rs.initiate() and rs.add("<hostname><:port>") properly. I found this SO answer explaining why I can't start everything just from the shell , without calling rs.initiate() , so how can I accomplish that? Oh, and I am using mongo:latest (v2.6.5) as base image, without any

Why do my volumes sometime not get mounted in my Docker container when using fig?

谁说我不能喝 提交于 2019-12-07 03:22:34
问题 I'm seeing a strange problem in a Docker/Fig environment. My hypothesis is that it's due to a delay in mounting volumes to containers, but I'm not sure how to confirm that. I have a container with the following: Dockerfile FROM busybox MAINTAINER Dan Rumney <email> ADD loadsnapshot.sh /loadsnapshot.sh RUN ["chmod", "u+x", "/loadsnapshot.sh"] VOLUME ["/snapshot"] ENTRYPOINT ["/loadsnapshot.sh"] loadsnapshot.sh #!/bin/sh if [ "$( ls -A /snapshot)" ]; then echo "Loading snapshot..." # Do stuff

docker-compose: using multiple Dockerfiles for multiple services

…衆ロ難τιáo~ 提交于 2019-12-05 13:38:18
问题 I'm using docker-compose and I'd like to use different Dockerfiles for different services' build steps. The docs seem to suggest to place different Dockerfiles in different directories, but I'd like them all to be in the same one (and perhaps distinguishable using the following convention: Dockerfile.postgres, Dockerfile.main...). Is this possible? Edit: The scenario I have contains this docker-compose file: main: build: . volumes: - .:/code environment: - DEBUG=true postgresdb: extends: file

Why do my volumes sometime not get mounted in my Docker container when using fig?

自作多情 提交于 2019-12-05 08:06:37
I'm seeing a strange problem in a Docker/Fig environment. My hypothesis is that it's due to a delay in mounting volumes to containers, but I'm not sure how to confirm that. I have a container with the following: Dockerfile FROM busybox MAINTAINER Dan Rumney <email> ADD loadsnapshot.sh /loadsnapshot.sh RUN ["chmod", "u+x", "/loadsnapshot.sh"] VOLUME ["/snapshot"] ENTRYPOINT ["/loadsnapshot.sh"] loadsnapshot.sh #!/bin/sh if [ "$( ls -A /snapshot)" ]; then echo "Loading snapshot..." # Do stuff else echo "No snapshot to load" fi In my fig.yml file I have: pdsvol: image: busybox volumes: - "/opt

Python数据可视化之matplotlib

混江龙づ霸主 提交于 2019-12-04 22:03:39
常用模块导入 import numpy as np import matplotlib import matplotlib.mlab as mlab import matplotlib.pyplot as plt import matplotlib.font_manager as fm from mpl_toolkits.mplot3d import Axes3D 解决显示异常问题 中文乱码 myfont = fm.FontProperties(fname="字体文件路径") 负号显示为方块 matplotlib.rcParams['axes.unicode_minus']=False 折线图 生成数据 x = np.linspace(-np.pi, np.pi, 256, endpoint=True) # 从-π到π 等间隔取256个点 y_cos, y_sin = np.cos(x), np.sin(x) # 对应x的cos与sin值 初始化画布 plt.figure(figsize=(8, 6), dpi=80) # figsize定义画布大小,dpi定义画布分辨率 plt.title("简单折线图", fontproperties=myfont) # 设定标题,中文需要指定字体 plt.grid(True) # 是否显示网格 设置坐标轴 # 设置X轴 plt.xlabel(

docker-compose: using multiple Dockerfiles for multiple services

谁说我不能喝 提交于 2019-12-04 00:11:00
I'm using docker-compose and I'd like to use different Dockerfiles for different services' build steps. The docs seem to suggest to place different Dockerfiles in different directories, but I'd like them all to be in the same one (and perhaps distinguishable using the following convention: Dockerfile.postgres, Dockerfile.main...). Is this possible? Edit: The scenario I have contains this docker-compose file: main: build: . volumes: - .:/code environment: - DEBUG=true postgresdb: extends: file: docker-compose.yml service: main build: utils/sql/ ports: - "5432" environment: - DEBUG=true where