Start MSQL Schema and config the YML for docker
the 'special' words are in properties file.
This commit is contained in:
@@ -3,13 +3,13 @@ CREATE DATABASE bricklog_db
|
|||||||
GO
|
GO
|
||||||
|
|
||||||
-- Grant Permissions & Flush
|
-- Grant Permissions & Flush
|
||||||
GRANT ALL PERMISSIONS TO bl_server IDENTIFIED BY l3g0D3t41l$h3r3
|
GRANT ALL PERMISSIONS TO bl_server
|
||||||
GO
|
GO
|
||||||
|
|
||||||
-- Create a new table called 'collection_table' in schema 'bricklog_db'
|
-- Create a new table called 'collection_table' in schema 'bricklog_db'
|
||||||
-- Create the table in the specified schema
|
-- Create the table in the specified schema
|
||||||
CREATE TABLE lego_builds (
|
CREATE TABLE lego_builds (
|
||||||
id INT NOT NULL PRIMARY KEY, -- Lego Build ID can be used here (hence not Auto_increment)
|
legoId INT NOT NULL PRIMARY KEY, -- Lego Build ID can be used here (hence not Auto_increment)
|
||||||
builder VARCHAR(255) NOT NULL,
|
builder VARCHAR(255) NOT NULL,
|
||||||
buildName VARCHAR(255) NOT NULL,
|
buildName VARCHAR(255) NOT NULL,
|
||||||
is_kitset BOOLEAN NOT NULL,
|
is_kitset BOOLEAN NOT NULL,
|
||||||
|
@@ -1,29 +1,12 @@
|
|||||||
version: '0.1'
|
version: '0.1'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
bricklog-server:
|
bricklog_server:
|
||||||
|
container_name: BrickLog_Server
|
||||||
build:
|
build:
|
||||||
context: ./BrickLog-Server
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080" # Adjust based on your server's port
|
- "8080:8080" # Expose the application on port 8080
|
||||||
environment:
|
extra_hosts:
|
||||||
- SPRING_DATASOURCE_URL=jdbc:mariadb://db:3306/bricklog
|
- "host.docker.internal:host-gateway" # Enables access to the host's MariaDB instance
|
||||||
- SPRING_DATASOURCE_USERNAME=bl_server
|
|
||||||
- SPRING_DATASOURCE_PASSWORD=l3g0D3t41l$h3r3
|
|
||||||
depends_on:
|
|
||||||
- db # Ensure the database starts before the server
|
|
||||||
|
|
||||||
db:
|
|
||||||
image: mysql:8.0
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
MYSQL_DATABASE: bricklog
|
|
||||||
MYSQL_ROOT_PASSWORD: root # Set a strong password in production
|
|
||||||
ports:
|
|
||||||
- "3306:3306" # Expose MySQL port
|
|
||||||
volumes:
|
|
||||||
- db_data:/var/lib/mysql # Persist database data
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
db_data:
|
|
@@ -1,7 +1,8 @@
|
|||||||
# MariaDB Configuration
|
# Database configuration
|
||||||
spring.datasource.url=jdbc:mariadb://localhost:3306/bricklog_db
|
spring.datasource.url=jdbc:mariadb://host.docker.internal:3306/bricklog
|
||||||
spring.datasource.username=your_db_username
|
spring.datasource.username=bricklog
|
||||||
spring.datasource.password=your_db_password
|
spring.datasource.password=your_password_here
|
||||||
|
|
||||||
|
|
||||||
# JPA settings
|
# JPA settings
|
||||||
spring.jpa.hibernate.ddl-auto=update # Creates tables automatically; set to 'none' in production if not needed
|
spring.jpa.hibernate.ddl-auto=update # Creates tables automatically; set to 'none' in production if not needed
|
||||||
|
Reference in New Issue
Block a user