English | Deutsch
This is part of an sample project how to use Angular with Spring Boot using Docker.
Introduction:
The project has been split into a client-side and a server-side part. This server-side part uses Java 8, Gradle & Spring Boot.
It uses a MySQL database (for now). It can be changed easily in the application.properties
for any other database.
You need to have Java 8 & MySQL installed.
For help getting started with Spring Boot, view their online documentation.
To test that it works, open a browser tab at http://localhost:8080.
Spring Boot Configuration | Class or Java property files |
---|---|
The Main Class | DockerSpringAngularApplication |
Properties Files | application.properties |
CORS Config | WebSecurityConfig |
Here are some example snippets to help you get started creating a container.
Compatible with docker-compose v3 schemas.
version: "3"
services:
spring-boot:
container_name: spring-boot
ports:
- 8080:8080
image: saschabrockel/docker-spring-angular:backend
environment:
spring.datasource.url: jdbc:mysql://db:3306/dockerSpringAngular
spring.datasource.username: brockel
spring.datasource.password: develop
angular.service.base-path: http://localhost
TZ: Europe/Berlin
depends_on:
- db
restart: unless-stopped
db:
container_name: db
ports:
- 3306:3306
image: mysql:8.0.21
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: dockerSpringAngular
MYSQL_USER: brockel
MYSQL_PASSWORD: develop
cap_add:
- SYS_NICE
restart: unless-stopped
Please don't forget that you need a running database instance of MySQL! Otherwise it won't work.
- Sascha Brockel