Forked from emreozcan3320/MySql-PhpMyAdmin-SpringBoot-Angular-Docker-Compose.yaml
Created
May 30, 2021 19:41
-
-
Save alexlondon07/7cfbcde0559eafb3ac3b3ebdd5ce66a6 to your computer and use it in GitHub Desktop.
a docker compose file for MySql, PhpMyAdmin, SpringBoot and Angular CRUD web application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3.3" | |
| #Define services | |
| services: | |
| #MySql Database for application | |
| mysql-db: | |
| image: mysql | |
| restart: always | |
| container_name: mysql-db | |
| #Environment variable for password and default database | |
| environment: | |
| MYSQL_ROOT_PASSWORD: 'password' | |
| MYSQL_DATABASE: 'crud-application' | |
| ports: | |
| - 3306:3306 #Forwars the exposed port 3306 on the container to port 3306 on the host machine | |
| volumes: | |
| - ./dump.sql:/docker-entrypoint-initdb.d/dump.sql | |
| #MySql Web UI | |
| php-my-admin: | |
| image: phpmyadmin | |
| restart: always | |
| container_name: php-my-admin | |
| ports: | |
| - 8081:80 #Forwars the exposed port 80 on the container to port 8081 on the host machine | |
| environment: | |
| PMA_HOST: mysql-db | |
| #Back-end Spring Boot Application | |
| springboot-app: | |
| #The docker file in BE, build the jar and provides the docker image. | |
| build: ./BE | |
| container_name: springboot-app | |
| #Environment variable for Spring Boot Application. | |
| environment: | |
| MYSQL_HOST: 'mysql-db' | |
| MYSQL_USER: 'root' | |
| MYSQL_PASSWORD: 'password' | |
| MYSQL_DATABASE: 'crud-application' | |
| ports: | |
| - 8080:8080 #Forwars the exposed port 8080 on the container to port 8080 on the host machine | |
| links: | |
| - mysql-db | |
| #Front-end Angular Application | |
| angular-app: | |
| #The docker file in FE, builds and provides the docker image. | |
| build: ./FE | |
| container_name: angular-app | |
| ports: | |
| - 4200:4200 #Forwars the exposed port 4200 on the container to port 4200 on the host machine | |
| links: | |
| - springboot-app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment