mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add infos for creating dbs for login- and community-server
This commit is contained in:
parent
fb5e804e41
commit
e450936a9d
5
mariadb/.skeema
Normal file
5
mariadb/.skeema
Normal file
@ -0,0 +1,5 @@
|
||||
[production]
|
||||
flavor=mariadb:10.5
|
||||
host=127.0.0.1
|
||||
port=3306
|
||||
user=root
|
||||
3
mariadb/.skeema.community
Normal file
3
mariadb/.skeema.community
Normal file
@ -0,0 +1,3 @@
|
||||
default-character-set=utf8mb4
|
||||
default-collation=utf8mb4_unicode_ci
|
||||
schema=gradido_community
|
||||
3
mariadb/.skeema.login
Normal file
3
mariadb/.skeema.login
Normal file
@ -0,0 +1,3 @@
|
||||
default-character-set=utf8mb4
|
||||
default-collation=utf8mb4_unicode_ci
|
||||
schema=gradido_login
|
||||
74
mariadb/Dockerfile
Normal file
74
mariadb/Dockerfile
Normal file
@ -0,0 +1,74 @@
|
||||
#########################################################################################################
|
||||
# Build skeema
|
||||
#########################################################################################################
|
||||
FROM golang:1.14.4 as skeema_build
|
||||
RUN go get -d -v github.com/skeema/skeema
|
||||
WORKDIR /go/src/github.com/skeema/skeema
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/bin/skeema .
|
||||
|
||||
#########################################################################################################
|
||||
# mariadb server
|
||||
#########################################################################################################
|
||||
From mariadb/server:10.5 as mariadb_server
|
||||
|
||||
#ENV DOCKER_WORKDIR="/docker-entrypoint-initdb.d"
|
||||
ENV DOCKER_WORKDIR="/skeema"
|
||||
|
||||
# copy skeema
|
||||
COPY --from=skeema_build /go/bin/skeema /usr/bin/
|
||||
|
||||
RUN mkdir -p ${DOCKER_WORKDIR}
|
||||
WORKDIR ${DOCKER_WORKDIR}
|
||||
#COPY ./mariadb/.skeema .
|
||||
COPY ./login_server/skeema/ .
|
||||
#COPY ./mariadb/.skeema.login ./gradido_login/.skeema
|
||||
COPY ./gradido_community_server/skeema/ .
|
||||
|
||||
|
||||
|
||||
#USER mysql
|
||||
#VOLUME /var/lib/mysql
|
||||
#RUN mysqld
|
||||
#RUN mysql -e 'CREATE DATABASE gradido_login_server;'
|
||||
#RUN mysql -e 'CREATE DATABASE gradido_community_server;'
|
||||
|
||||
|
||||
#RUN skeema push
|
||||
|
||||
#########################################################################################################
|
||||
# mariadb server selfmade
|
||||
#########################################################################################################
|
||||
From alpine:latest as mariadb_DIV
|
||||
|
||||
ENV DOCKER_WORKDIR="/skeema"
|
||||
|
||||
|
||||
|
||||
#RUN apt-get update \
|
||||
# && apt-get -y --no-install-recommends install mariadb-server mariadb-client \
|
||||
# && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
|
||||
RUN apk add mariadb mariadb-client
|
||||
|
||||
# copy skeema
|
||||
COPY --from=skeema_build /go/bin/skeema /usr/bin/
|
||||
|
||||
RUN mkdir -p ${DOCKER_WORKDIR}
|
||||
WORKDIR ${DOCKER_WORKDIR}
|
||||
|
||||
COPY ./mariadb/setup_dbs.sh .
|
||||
COPY ./mariadb/.skeema .
|
||||
COPY ./login_server/skeema/ .
|
||||
COPY ./mariadb/.skeema.login ./gradido_login/.skeema
|
||||
COPY ./community_server/skeema/ .
|
||||
COPY ./mariadb/.skeema.community ./gradido_community/.skeema
|
||||
|
||||
USER mysql
|
||||
#VOLUME /var/lib/mysql
|
||||
RUN mysqld
|
||||
RUN chmod +x ./setup_dbs.sh
|
||||
RUN mysql < setup_dbs.sql
|
||||
RUN skeema push
|
||||
|
||||
EXPOSE 3306
|
||||
|
||||
CMD ["mysld"]
|
||||
10
mariadb/setup_dbs.sh
Normal file
10
mariadb/setup_dbs.sh
Normal file
@ -0,0 +1,10 @@
|
||||
create database gradido_login
|
||||
DEFAULT CHARACTER SET utf8mb4
|
||||
DEFAULT COLLATE utf8mb4_unicode_ci;
|
||||
create database IF NOT EXISTS _skeema_tmp
|
||||
DEFAULT CHARACTER SET utf8mb4
|
||||
DEFAULT COLLATE utf8mb4_unicode_ci;
|
||||
CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASSWD';
|
||||
GRANT ALL PRIVILEGES ON gradido_login.* TO '$DB_USER'@'localhost';
|
||||
GRANT ALL PRIVILEGES ON _skeema_tmp.* TO '$DB_USER'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
10
mariadb/setup_dbs.sql
Normal file
10
mariadb/setup_dbs.sql
Normal file
@ -0,0 +1,10 @@
|
||||
create database gradido_login
|
||||
DEFAULT CHARACTER SET utf8mb4
|
||||
DEFAULT COLLATE utf8mb4_unicode_ci;
|
||||
create database gradido_community
|
||||
DEFAULT CHARACTER SET utf8mb4
|
||||
DEFAULT COLLATE utf8mb4_unicode_ci;
|
||||
create database IF NOT EXISTS _skeema_tmp
|
||||
DEFAULT CHARACTER SET utf8mb4
|
||||
DEFAULT COLLATE utf8mb4_unicode_ci;
|
||||
FLUSH PRIVILEGES;
|
||||
Loading…
x
Reference in New Issue
Block a user