Skip to content

Latest commit

 

History

History
82 lines (59 loc) · 2.66 KB

README.md

File metadata and controls

82 lines (59 loc) · 2.66 KB

English | Deutsch

Docker-Spring-Angular

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.

Database

It uses a MySQL database (for now). It can be changed easily in the application.properties for any other database.

Requirements

You need to have Java 8 & MySQL installed.

Getting Started

For help getting started with Spring Boot, view their online documentation.

To test that it works, open a browser tab at http://localhost:8080.

Looking for something in particular?

Spring Boot Configuration Class or Java property files
The Main Class DockerSpringAngularApplication
Properties Files application.properties
CORS Config WebSecurityConfig

Usage

Here are some example snippets to help you get started creating a container.

docker-compose

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.

Built with

Spring Boot

Developer

  • Sascha Brockel