summaryrefslogtreecommitdiff
path: root/compose.yaml
blob: 8892fdad2e5b4944b2f6ec91f28712630738b448 (plain)
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
67
68
69
70
71
72
73
74
#Tutorial acelerado de docker compose
# O Docker compose é uma ferramenta para definir e
# executar aplicações com múltiplos contâineres.

# Todos os valores que começam com '$' são variáveis
# que variam de acordo com a instalação. Você define estes valores
# em um arquivo chamado '.env' no mesmo diretório deste arquivo.
# nota: NUNCA suba o arquivo .env para o git.

# Lista de serviços
services:
  mosquitto:
    image: "eclipse-mosquitto:2.0.22"
    ports:
      - "127.0.0.1:1883:1883"
    volumes:
      - type: bind
        source: ./mosquitto-config/
        target: /mosquitto/config/
    networks:
      - mosquitto
  mqtt-client:
    environment:
      MQTT_CLIENT_USER: ${MQTT_CLIENT_USER}
      MQTT_CLIENT_PASSWORD: ${MQTT_CLIENT_PASSWORD}
      DATABASE_URL: postgresql://root:public@postgres:5432/control_station
    build:
      context: ./mqtt_client/
    networks:
      - mosquitto
      - database
    depends_on:
      - mosquitto
      - postgres
  postgres:
    image: postgres:13
    container_name: postgres
    networks:
      - database
    environment:
      POSTGRES_PASSWORD: public
      POSTGRES_USER: root
      POSTGRES_DB: control_station
    volumes:
      #- ${PWD}/database/init_scripts:/docker-entrypoint-initdb.d
      - db_data:/var/lib/postgresql/data
  pgadmin:
    image: dpage/pgadmin4
    container_name: pgadmin
    environment:
      - PGADMIN_DEFAULT_EMAIL=admin@admin.com
      - PGADMIN_DEFAULT_PASSWORD=admin
    ports:
      - "5050:80"
    networks:
      - database
    depends_on:
      - postgres
  api:
    build:
      context: ./api/
    networks:
      - database
    ports:
      - "127.0.0.1:8000:80"
    depends_on:
      - postgres

networks:
  mosquitto:
  database:

volumes:
  db_data: