Work on SettingsWindow and Server
This commit is contained in:
19
BrickLog-Server/sql/schema.sql
Normal file
19
BrickLog-Server/sql/schema.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
-- Create a new database called 'bricklog_db'
|
||||
CREATE DATABASE bricklog_db
|
||||
GO
|
||||
|
||||
-- Grant Permissions & Flush
|
||||
GRANT ALL PERMISSIONS TO bl_server IDENTIFIED BY l3g0D3t41l$h3r3
|
||||
GO
|
||||
|
||||
-- Create a new table called 'collection_table' in schema 'bricklog_db'
|
||||
-- Create the table in the specified schema
|
||||
CREATE TABLE lego_builds (
|
||||
id INT NOT NULL PRIMARY KEY, -- Lego Build ID can be used here (hence not Auto_increment)
|
||||
builder VARCHAR(255) NOT NULL,
|
||||
buildName VARCHAR(255) NOT NULL,
|
||||
is_kitset BOOLEAN NOT NULL,
|
||||
buildDescription VARCHAR(1000) NOT NULL,
|
||||
record_created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
GO
|
7
BrickLog-Server/src/.dockerignore
Normal file
7
BrickLog-Server/src/.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
||||
sql/
|
||||
target/
|
||||
*.log
|
||||
*.class
|
||||
.idea/
|
||||
*.iml
|
||||
*.DS_Store
|
14
BrickLog-Server/src/Dockerfile
Normal file
14
BrickLog-Server/src/Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
# Use a base image that includes JDK
|
||||
FROM openjdk:21-jdk-slim
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the built JAR file into the container
|
||||
COPY target/BrickLog-Server-0.1.jar app.jar
|
||||
|
||||
# Expose the port your application runs on
|
||||
EXPOSE 8080
|
||||
|
||||
# Command to run the application
|
||||
ENTRYPOINT ["java", "-jar", "app.jar"]
|
29
BrickLog-Server/src/docker-compose.yml
Normal file
29
BrickLog-Server/src/docker-compose.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
version: '0.1'
|
||||
|
||||
services:
|
||||
bricklog-server:
|
||||
build:
|
||||
context: ./BrickLog-Server
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "8080:8080" # Adjust based on your server's port
|
||||
environment:
|
||||
- SPRING_DATASOURCE_URL=jdbc:mariadb://db:3306/bricklog
|
||||
- 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:
|
Reference in New Issue
Block a user