File size: 1,380 Bytes
66c0d0c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
services:
  dapa_be:
    build:
      context: .
      dockerfile: Dockerfile.server
    container_name: dapa_backend
    depends_on:
        - dapa_pg
    ports:
      - "8080:8080"
    env_file:
      - .env
    environment:
      - DATABASE_URL=postgresql+asyncpg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@dapa_pg:${POSTGRES_PORT}/${POSTGRES_DB}
    networks:
      - dapa-network


  dapa_streamlit_fe:
      build:
        context: .
        dockerfile: Dockerfile.client
      container_name: dapa_streamlit
      ports:
        - "8088:8088"
      depends_on:
        - dapa_be
      environment:
        - BACKEND_URL=http://dapa_backend:8080
      networks:
        - dapa-network
      develop:
        watch:
          - path: src/client/
            action: sync+restart
            target: /app/client/
          - path: src/schema/
            action: sync+restart
            target: /app/schema/
          - path: src/interface.py
            action: sync+restart
            target: /app/interface.py
  
  dapa_pg:
    image: postgres:latest
    container_name: dapa_pg
    ports:
      - "5432:5432"
    env_file:
      - .env
    networks:
      - dapa-network
    volumes:
      - pg_db_1:/var/lib/postgresql/data

volumes:
  pg_db_1:

networks:
  dapa-network:

# To build and run the app:
# docker compose up --build -d
# or for dev easy
# docker compose watch