Database creation and db schema install

This commit is contained in:
eroncero 2025-02-26 21:06:33 +01:00
parent f465c9072c
commit 22c7a98cc9
2 changed files with 16 additions and 1 deletions

15
app/DATABASE_CREATION.sql Normal file
View File

@ -0,0 +1,15 @@
-- Create a database for ForgottenServer
CREATE DATABASE IF NOT EXISTS forgottenserver CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
-- Create a user for specific for the database
CREATE USER IF NOT EXISTS forgottenserver@localhost IDENTIFIED BY 'forgotten';
-- Set privileges to the new user
GRANT ALL PRIVILEGES ON forgottenserver.* TO 'forgottenserver'@'localhost';
FLUSH PRIVILEGES;
-- forgottenserver database schema installation
SOURCE '/home/tibia/SabrehavenServer/sabrehaven.sql';
-- ZnoteAAC database schema installation
SOURCE '/var/www/ZnoteAAC/engine/database/znote_schema.sql';

View File

@ -4,9 +4,9 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update && apt-get upgrade -y && apt-get install -y git cmake build-essential libluajit-5.1-dev libmariadb-dev-compat libboost-date-time-dev libboost-system-dev libboost-iostreams-dev libpugixml-dev libcrypto++-dev libfmt-dev zlib1g-dev libgmp-dev libboost-all-dev curl iproute2
#RUN useradd -m -s /bin/bash tibia && mv /app/SabrehavenServer /home/tibia && chown -R tibia:tibia /home/tibia/SabrehavenServer
RUN useradd -m -s /bin/bash tibia
RUN echo "tibia:tibia" | chpasswd
RUN chown -R tibia:tibia /home/tibia
#USER tibia
WORKDIR /home/tibia