Skip to content

Commit

Permalink
Merge pull request #128 from bigcapitalhq/BIG-435-migrate-to-maria-db…
Browse files Browse the repository at this point in the history
…-v-11

feat: migrate the server to MariaDB
  • Loading branch information
abouolia authored Jun 4, 2023
2 parents 68231d5 + ffe51ba commit aec09f1
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ MAIL_FROM_NAME=
MAIL_FROM_ADDRESS=

# Database
DB_USER=
DB_HOST=
DB_USER=
DB_PASSWORD=
DB_ROOT_PASSWORD=
DB_CHARSET=

# System database
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ services:
mysql:
container_name: bigcapital-mysql
build:
context: ./docker/mysql
context: ./docker/mariadb
environment:
- MYSQL_DATABASE=${SYSTEM_DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
volumes:
- mysql:/var/lib/mysql
expose:
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
version: '3.3'

services:
mysql:
mariadb:
build:
context: ./docker/mysql
context: ./docker/mariadb
environment:
- MYSQL_DATABASE=${SYSTEM_DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
volumes:
- mysql:/var/lib/mysql
expose:
Expand Down
4 changes: 2 additions & 2 deletions docker/mysql/Dockerfile → docker/mariadb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mysql:5.7
FROM mariadb:10.2

USER root
ADD my.cnf /etc/mysql/conf.d/my.cnf
Expand All @@ -17,7 +17,7 @@ ENV MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD
COPY ./init.sql /scripts/init.template.sql
COPY ./docker-entrypoint.sh /docker-entrypoint-initdb.d/docker-initialize.sh

# The scripts in the docker-entrypoint-initdb.d/ directory are executed as
# The scripts in the `docker-entrypoint-initdb.d/` directory are executed as
# the mysql user inside the MySQL Docker container.
RUN chown -R mysql:root /docker-entrypoint-initdb.d
RUN chown -R mysql:root /scripts
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions docker/mysql/init.sql → docker/mariadb/init.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
GRANT ALL PRIVILEGES ON *.* TO '{MYSQL_USER}'@'%' IDENTIFIED BY '{MYSQL_PASSWORD}' WITH GRANT OPTION;

FLUSH PRIVILEGES;
File renamed without changes.

1 comment on commit aec09f1

@vercel
Copy link

@vercel vercel bot commented on aec09f1 Jun 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.