add phpmyadmin for db debugging, fix mariadb code, insert use table at beginning of sql files

This commit is contained in:
einhornimmond 2021-02-18 13:27:19 +01:00
parent 6c648b3f99
commit 9ee72fb8f2
4 changed files with 20 additions and 15 deletions

View File

@ -65,6 +65,21 @@ services:
volumes:
- ./logs:/var/log/nginx
## for debugging mariadb
phpmyadmin:
image: phpmyadmin
container_name: phpmyadmin
environment:
- PMA_ARBITRARY=1
restart: always
ports:
- 8080:80
networks:
- internal-net
- external-net
volumes:
- /sessions
# image: ocelotsocialnetwork/backend:development
# build:
# target: development

View File

@ -45,8 +45,7 @@ services:
container_name: mariadb
environment:
- MARIADB_ALLOW_EMPTY_PASSWORD=1
- MARIADB_USER='root'
- MARIADB_DATABASE='gradido_login'
- MARIADB_USER=root
networks:
- internal-net
ports:

View File

@ -29,11 +29,12 @@ WORKDIR ${DOCKER_WORKDIR}
COPY ./mariadb/setup_dbs.sql a_setup_dbs.sql
# login server db
COPY ./login_server/skeema/ .
RUN cd ./gradido_login/ && for f in *.sql; do cp -- "$f" "../b_$f"; done
RUN cd ./gradido_login/ && for f in *.sql; do cp -- "$f" "../b_$f"; sed -i '1i use gradido_login;' "../b_$f"; done
# community server db
COPY ./community_server/skeema/ .
RUN cd ./gradido_community/ && for f in *.sql; do cp -- "$f" "../c_$f"; done
RUN cd ./gradido_community/insert && for f in *.sql; do cp -- "$f" "../../d_$f"; done
RUN cd ./gradido_community/ && for f in *.sql; do cp -- "$f" "../d_$f"; sed -i '1i use gradido_community;' "../d_$f"; done
RUN cd ./gradido_community/insert && for f in *.sql; do cp -- "$f" "../../e_$f"; sed -i '1i use gradido_community;' "../../e_$f"; done
RUN ls -ls

View File

@ -1,10 +0,0 @@
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;