Skip to content

Commit

Permalink
add readme, add m1 docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
yennanliu committed Feb 18, 2024
1 parent 4fd8cce commit 63f5cc0
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
13 changes: 13 additions & 0 deletions SpringDataPlatform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ ARCHITECTURE :

```bash
docker-compose up

#--------------------------
# Macbook m1
#--------------------------

# run
docker-compose -f docker-compose-m1.yml up

# rebuild (use updated java code) and run
docker-compose -f docker-compose-m1.yml up --build

# restart
docker-compose -f docker-compose-m1.yml restart
```

</details>
Expand Down
66 changes: 66 additions & 0 deletions SpringDataPlatform/docker-compose-m1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: '3'
services:
app:
restart: always
build: ./backend/DataPlatform
working_dir: /app
volumes:
- ./backend/DataPlatform:/app
ports:
- "9999:9999"
platform: linux/amd64
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/data_platform
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=
- SPRING_DATASOURCE_DRIVER_CLASS_NAME=com.mysql.cj.jdbc.Driver
- SPRING_JPA_SHOW_SQL=true
- SPRING_JPA_HIBERNATE_DDL_AUTO=create # Set the Hibernate ddl-auto property here
- SPRING_JPA_GENERATE_DDL=true
#- JAVA_HOME=/usr/local/openjdk-11
depends_on:
- mysql
command: mvn clean spring-boot:run -DskipTests

vue:
restart: always
build: ./frontend/data-platform-ui
working_dir: /app
platform: linux/amd64
ports:
- "8080:8080" # Map host port 8080 to container port 8080
volumes:
- ./frontend/data-platform-ui:/app # Mount the current directory into the container
command: npm run serve

mysql:
image: mysql:5.7
restart: always
platform: linux/amd64
environment:
#https://stackoverflow.com/questions/66831863/mysql-docker-container-keeps-restarting
#MYSQL_USER: root # NO NEED to create root user, since it is created automatically
MYSQL_DATABASE: data_platform
MYSQL_ROOT_PASSWORD:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
ports:
- "3306:3306"
volumes:
- mysql-data:/var/lib/mysql

nginx:
image: nginx
restart: always
platform: linux/amd64
ports:
#- "8080:80"
- "8081:8081"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/index.html:/app/html:ro
depends_on:
- app
#- app2

volumes:
mysql-data:

0 comments on commit 63f5cc0

Please sign in to comment.