diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3b2a834 --- /dev/null +++ b/.env.example @@ -0,0 +1,15 @@ +NETWORKS_DRIVER=bridge +VOLUMES_DRIVER=local +TIMEZONE=UTC +DATA_PATH=./data + +################# MoneyWhere ################### +PLAYEDU_PC_PORT=9800 +PLAYEDU_ADMIN_PORT=9900 + +################# MySQL ################### +MYSQL_HOST=mysql +MYSQL_PORT=3306 +MYSQL_DATABASE=moneywhere +MYSQL_USER=root +MYSQL_ROOT_PASSWORD=123456 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/README.md b/README.md index b5cd32d..9f7c8ac 100644 --- a/README.md +++ b/README.md @@ -1 +1,4 @@ -# docker-compose-moneywhere +# 九快记账 + +使用docker compose一键部署自己的记账程序。 + diff --git a/api.env b/api.env new file mode 100644 index 0000000..fafbe88 --- /dev/null +++ b/api.env @@ -0,0 +1,18 @@ +DB_HOST=mysql +DB_PORT=3306 +DB_NAME=moneywhere +DB_USER=root +DB_PASSWORD=123456 +SERVER_PORT=9092 +DDL_AUTO=update +SHOW_SQL=true + +invite_code=111111 + +wxopen_appsecret=xxxxxxxxxxxx +wxopen_appid=xxxxxxxxxxx +wxopen_redirect_url=http://xxxxxxxxxxxx/api/v1/loginWechat/callback +wxopen_appsecret_app=xxxxxxxxxxxxxx +wxopen_appid_app=xxxxxxxxxxxxx + +user_api_base_url=https://api.moneywhere.com/api/v1/user-api/ \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7bbf7a9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,42 @@ +version: '3.6' + +services: + mysql: + build: ./mysql/ + command: --init-file /data/1.sql + restart: always + environment: + - MYSQL_ROOT_PASSWORD=123456 + volumes: + - mysql_data:/var/lib/mysql + + phpmyadmin: + depends_on: + - mysql + image: phpmyadmin/phpmyadmin + ports: + - "8085:80" + environment: + PMA_ARBITRARY: 1 + PMA_HOST: mysql + PMA_USER: root + PMA_PASSWORD: 123456 + + moneywhere-api-user: + depends_on: + - mysql + image: markliu2018/moneywhere-api-user:latest + env_file: api.env + + moneywhere-fe-user: + depends_on: + - moneywhere-api-user + image: markliu2018/moneywhere-fe-user:latest + environment: + USER_API_HOST: http://moneywhere-api-user:9092 + API_HOST: https://api.moneywhere.com/api/v1/user-api + ports: + - "6060:80" + +volumes: + mysql_data: \ No newline at end of file diff --git a/mysql/Dockerfile b/mysql/Dockerfile new file mode 100644 index 0000000..66e8a3d --- /dev/null +++ b/mysql/Dockerfile @@ -0,0 +1,14 @@ +FROM mysql:8.0 + +#ARG TZ=UTC +#ENV TZ ${TIMEZONE} +#RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone && chown -R mysql:root /var/lib/mysql/ + +COPY my.cnf /etc/mysql/conf.d/my.cnf +COPY init.sql /data/1.sql + +RUN chmod 0444 /etc/mysql/conf.d/my.cnf + +CMD ["mysqld"] + +EXPOSE 3306 diff --git a/mysql/init.sql b/mysql/init.sql new file mode 100644 index 0000000..5b79bd8 --- /dev/null +++ b/mysql/init.sql @@ -0,0 +1,2 @@ +CREATE DATABASE moneywhere CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; +USE moneywhere; \ No newline at end of file diff --git a/mysql/my.cnf b/mysql/my.cnf new file mode 100644 index 0000000..4a90b1b --- /dev/null +++ b/mysql/my.cnf @@ -0,0 +1,14 @@ +# The MySQL Client configuration file. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +[mysql] + +[mysqld] +character-set-server=utf8mb4 +default-time-zone='+8:00' +innodb_rollback_on_timeout='ON' +max_connections=500 +innodb_lock_wait_timeout=500 +default-authentication-plugin=mysql_native_password \ No newline at end of file