Projekt

Obecné

Profil

« Předchozí | Další » 

Revize ae654ef7

Přidáno uživatelem Jakub Šmíd před asi 2 roky(ů)

Database exported to script
- removed initialization from application
- updated docker-compose.yml to create volume and add data from script

re #9746

Zobrazit rozdíly:

backend/docker-compose.yml
5 5
    image: postgres:14.2
6 6
    container_name: postgres-db
7 7
    environment:
8
      - POSTGRES_DB=test                # database name
9
      - POSTGRES_USER=test              # database user
10
      - POSTGRES_PASSWORD=Password.123  # database password
8
      - POSTGRES_DB=backend-db                # database name
9
      - POSTGRES_USER=backend-db              # database user
10
      - POSTGRES_PASSWORD=gLt7*6d@pL!kAC8A8j8w  # database password
11 11
    expose:
12 12
      - 5432
13 13
    ports:
14 14
      - "5432:5432"                # expose port 5432 (PostgreSQL) out of the docker container to the local machine
15 15
    volumes:
16
      - db-data:/var/lib/postgresql/data
16
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql
17
      - db-data:/var/lib/postgresql/dat
17 18

  
18 19

  
19
  app: # Spring boot application
20
    build: .
21
    container_name: app-backend  # name of the container
22
    image: schwobik/backend-app:1.5
23
    ports:
24
      - "8080:8080"                 # expose port 8080 out of the docker container do the local machine
25
    depends_on:
26
      - db
27
    environment:
28
      - SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/test # overwrites application.properties datasource url to connect to the database
29

  
30
  frontend:
20
#  app: # Spring boot application
21
#    build: .
22
#    container_name: app-backend  # name of the container
23
#    image: schwobik/backend-app:1.5
24
#    ports:
25
#      - "8080:8080"                 # expose port 8080 out of the docker container do the local machine
26
#    depends_on:
27
#      - db
28
#    environment:
29
#      - SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/test # overwrites application.properties datasource url to connect to the database
30
#
31
#  frontend:
31 32
#     Since our Dockerfile for web-server is located in react-app folder, our build context is ./react-app
32
    build: ../frontend
33
    container_name: frontend
34
    image: schwobik/frontend-app:1.5
35
    ports:
36
      - "80:80"
33
#    build: ../frontend
34
#    container_name: frontend
35
#    image: schwobik/frontend-app:1.5
36
#    ports:
37
#      - "80:80"
37 38

  
38 39
volumes:
39 40
  db-data:

Také k dispozici: Unified diff