Blame view

docker-compose.yml 1.5 KB
6ae5c09e   Antoine Goutenoir   Somehow, someday,...
1
# Orchestrate docker containers to host an instance of the project.
e9a989e0   Antoine Goutenoir   Review docker com...
2
3
# You *could* use this for development.  Don't.
# You *could* use this for production.  Don't.
6ae5c09e   Antoine Goutenoir   Somehow, someday,...
4

74f41194   Antoine Goutenoir   Sure, why not.
5
version: '2.0'
00580901   Antoine Goutenoir   Add a basic, ugly...
6
services:
80b2fc76   Antoine Goutenoir   config: update do...
7
8
    travel_footprint_calculator:
        container_name: travel_footprint_calculator
3ac85c09   Antoine Goutenoir   Continue tweaking...
9
        restart: always
00580901   Antoine Goutenoir   Add a basic, ugly...
10
        build: .
00580901   Antoine Goutenoir   Add a basic, ugly...
11
        volumes:
3ac85c09   Antoine Goutenoir   Continue tweaking...
12
13
14
15
16
17
18
19
        - .:/app

        # The server's nginx-reverse-proxy does not like ports.
        # Uncomment this to get it working on localhost for dev.
#        ports:
#        - "5000:5000"

        environment:
6ae5c09e   Antoine Goutenoir   Somehow, someday,...
20
            STATIC_PATH: /app/flaskr/static
3ac85c09   Antoine Goutenoir   Continue tweaking...
21
22
            # Config for server's nginx-reverse-proxy container
            LETSENCRYPT_HOST: travel-footprint-calculator.apps.goutenoir.com
16c55e61   Antoine Goutenoir   Continue duelling...
23
            LETSENCRYPT_EMAIL: antoine@goutenoir.com
3ac85c09   Antoine Goutenoir   Continue tweaking...
24
            VIRTUAL_HOST: travel-footprint-calculator.apps.goutenoir.com
3ac85c09   Antoine Goutenoir   Continue tweaking...
25
26
27
28
            VIRTUAL_PORT: 80
            ###################################################


80b2fc76   Antoine Goutenoir   config: update do...
29
30
    travel_footprint_calculator_mahcron:
        container_name: travel_footprint_calculator_mahcron
3ac85c09   Antoine Goutenoir   Continue tweaking...
31
        image: jsonfry/curl-cron
b4e0bfc3   Antoine Goutenoir   Make sure CRON re...
32
        restart: always
3ac85c09   Antoine Goutenoir   Continue tweaking...
33
        environment:
6ae5c09e   Antoine Goutenoir   Somehow, someday,...
34
35
            # https is important because all you'll get from http is a 301 ;)
            OPTIONS: "https://travel-footprint-calculator.apps.goutenoir.com/compute"
5fa64d17   Antoine Goutenoir   Making every shit...
36
            CRON_SCHEDULE: "*/3 * * * *"
6ae5c09e   Antoine Goutenoir   Somehow, someday,...
37

74f41194   Antoine Goutenoir   Sure, why not.
38
39
40
41
42

# Tip from https://github.com/jwilder/nginx-proxy/issues/1132#issuecomment-392460028
# Create it first: docker network create webproxy
networks:
    default:
b4e0bfc3   Antoine Goutenoir   Make sure CRON re...
43
44
        external:
            name: webproxy
74f41194   Antoine Goutenoir   Sure, why not.