Simple Web with Docker

Prerequisites

Setup this project from scratch

# Create Spring server from web starter
# Or use command:
spring init --dependencies=web,picocli,postgresql,devtools,security --build=maven --name=simpleserver --java-version=17 --spring-boot-version=3.1.8 simpleserver
tar -xvf simpleserver.tar.gz

# Create Angular app
# SCSS
ng new --no-create-application
ng generate application simplefe --style=scss

# ...

Start development

# Start server
mvn compile spring-boot:run -pl simpleserver

# npm
npm watch

Build and Package a Docker image

# Build
mvn -pl simpleserver clean

npm install
npm run build

mvn -pl simpleserver -DskipTests compile package

docker build -f Dockerfile.app -t simpleweb .

Build within a Docker container

docker build -t simpleweb .

Run the Docker image

docker run -p 8080:8080 simpleweb