Instruction | Comments |
---|---|
image: easygeoip_app |
Name of the docker image after build |
build: . |
Instruct docker compose to build the image with the Dockerfile under the current directory |
command: ["python", "/srv/app/main.py"] |
Change the default command so that the application can be restarted whenever the source code is updated |
volumes |
Mount the current directory at /srv/app in the application's container. This is very handy, since an update to the source code won''t require rebuilding the Docker Image (and hence restarting the application container) |
ports |
Map port 5000 on the container to port 5000 on the host. default all Flask's application use port 5000 the web server port so we're just making sure that it's accessible. |
environment |
Here were passing the environment variables required by the application. DEBUG=1 it's very important since Flask will restart the application whenever the source code is updated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
values = [ | |
dict(gni_ppp=7480, life_expectancy=79.6, education_index=0.768,country='CUBA', material_footprint=8.04, co2_emissions=3.42), | |
dict(gni_ppp=21000, life_expectancy=79.6, education_index=0.768,country='CUBA', material_footprint=8.04, co2_emissions=3.42), | |
dict(gni_ppp=14086, life_expectancy=79.6, education_index=0.713,country='COSTA RICA', material_footprint=8.08, co2_emissions=2.66), | |
dict(gni_ppp=53741, life_expectancy=79.2, education_index=0.9,country='US', material_footprint=32.36, co2_emissions=18.35), | |
dict(gni_ppp=38146, life_expectancy=81.4, education_index=0.911,country='UNITED KINGDOM', material_footprint=22.57, co2_emissions=10.08), | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thu Apr 5 18:19:52 UTC 2018 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app: | |
image: easygeoip_app | |
build: . | |
command: ["python", "/srv/app/main.py"] | |
volumes: | |
- .:/srv/app | |
ports: | |
- "5000:5000" | |
environment: | |
- DB_PASSWORD=thepassword |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:2.7-slim | |
MAINTAINER Yoanis Gil<[email protected]> | |
# Create the directory where we will copy the application code | |
RUN mkdir /srv/app | |
# ... and declare it as the default working directory | |
WORKDIR /srv/app | |
# Add Nginx repository so that we install a recent version | |
ADD ./docker/nginx.list /etc/apt/sources.list.d/nginx.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
import time | |
import telnetlib | |
check_timeout = int(os.environ.get('CHECK_TIMEOUT', 1)) | |
sleep_interval = int(os.environ.get('SLEEP_INTERVAL', 1)) | |
port_to_check = int(os.environ.get('PORT_TO_CHECK')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class AssetsBundleLoader : MonoBehaviour { | |
public GameObject prefabButton; | |
public RectTransform parentPanel; | |
private string url = "http://localhost:8080/tents"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
rancher: | |
image: rancher/server | |
container_name: rancher-server | |
restart: always | |
nginx: | |
image: nginx:1.11 | |
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
odoo: | |
image: odoo:9 | |
ports: | |
- "8069:8069/tcp" | |
links: | |
- "db:db" | |
db: | |
image: postgres:9 | |
environment: | |
- POSTGRES_USER=odoo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
master: | |
image: elasticsearch:2 | |
ports: | |
- "9200:9200" | |
restart: always | |
container_name: es_master | |
es-node: | |
image: elasticsearch:2 | |
command: elasticsearch --discovery.zen.ping.unicast.hosts=es_master |
NewerOlder