File: docker-compose.yml

package info (click to toggle)
gunicorn 25.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,048 kB
  • sloc: python: 43,889; sh: 285; javascript: 54; makefile: 38
file content (66 lines) | stat: -rw-r--r-- 1,984 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.

services:
  # Run the example tests (protocol, dirty app, worker integration)
  tests:
    build:
      context: ../..
      dockerfile: examples/dirty_example/Dockerfile
    command: >
      bash -c "
        echo '=== Running Protocol Tests ===' &&
        python examples/dirty_example/test_protocol.py &&
        echo '' &&
        echo '=== Running Dirty App Tests ===' &&
        python examples/dirty_example/test_dirty_app.py &&
        echo '' &&
        echo '=== Running Worker Integration Tests ===' &&
        python examples/dirty_example/test_worker_integration.py &&
        echo '' &&
        echo '=== All tests passed! ==='
      "

  # Run the full gunicorn server with dirty workers
  server:
    build:
      context: ../..
      dockerfile: examples/dirty_example/Dockerfile
    ports:
      - "8001:8000"
    environment:
      - GUNICORN_BIND=0.0.0.0:8000
    command: >
      gunicorn examples.dirty_example.wsgi_app:app
      -c examples/dirty_example/gunicorn_conf.py
    healthcheck:
      test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/')"]
      interval: 5s
      timeout: 5s
      retries: 5
      start_period: 10s

  # Run integration test against the server
  integration-test:
    build:
      context: ../..
      dockerfile: examples/dirty_example/Dockerfile
    depends_on:
      server:
        condition: service_healthy
    environment:
      - TEST_BASE_URL=http://server:8000
    command: python examples/dirty_example/test_integration.py

  # Run stash integration test against the server
  stash-test:
    build:
      context: ../..
      dockerfile: examples/dirty_example/Dockerfile
    depends_on:
      server:
        condition: service_healthy
    environment:
      - TEST_BASE_URL=http://server:8000
    command: python examples/dirty_example/test_stash_integration.py