From e853d0a3f8664f2152d428a2dcc66de6e9099534 Mon Sep 17 00:00:00 2001 From: lr <> Date: Fri, 2 Sep 2022 12:06:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0docker=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/.gitignore | 2 ++ docker/config/mysql/mysqld.cnf | 31 ++++++++++++++++ docker/docker-compose.yml | 64 ++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 docker/.gitignore create mode 100755 docker/config/mysql/mysqld.cnf create mode 100755 docker/docker-compose.yml diff --git a/docker/.gitignore b/docker/.gitignore new file mode 100644 index 00000000..b77a9232 --- /dev/null +++ b/docker/.gitignore @@ -0,0 +1,2 @@ +/data +/log \ No newline at end of file diff --git a/docker/config/mysql/mysqld.cnf b/docker/config/mysql/mysqld.cnf new file mode 100755 index 00000000..18fabc59 --- /dev/null +++ b/docker/config/mysql/mysqld.cnf @@ -0,0 +1,31 @@ +# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# +# The MySQL Server configuration file. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +[mysqld] +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock +datadir = /var/lib/mysql +log-error = /var/log/mysql/error.log +# By default we only accept connections from localhost +#bind-address = 127.0.0.1 +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links=0 +max_connections=1000 diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100755 index 00000000..e2aa15c5 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,64 @@ +version: '3' + +networks: + likeadmin: + driver: bridge + +services: + + maven: + container_name: likeadmin-java-maven + image: maven:3.8.6-openjdk-8 + restart: always + tty: true + working_dir: /likeadmin_java/server + volumes: + - ../server:/likeadmin_java/server + networks: + - likeadmin + ports: + - "8082:8082" + - "8083:8083" + command: bash + + + + mysql: + container_name: likeadmin-java-mysql + #image: mysql:5.7.29 #X86架构 + image: amd64/mysql:5.7.29 #arm架构 + restart: always + environment: + MYSQL_ROOT_PASSWORD: root + volumes: + - ./data/mysql5.7.29/lib:/var/lib/mysql + - ./config/mysql/mysqld.cnf:/etc/mysql/my.cnf + networks: + - likeadmin + ports: + - "3306:3306" + + + redis: + container_name: likeadmin-redis + image: redis:7.0.4 + restart: always + volumes: + - ./data/redis:/data + networks: + - likeadmin + ports: + - "6379:6379" + + node: + container_name: likeadmin-java-node + image: node:14.18.1 + restart: always + volumes: + - ../admin:/likeadmin_php/admin + networks: + - likeadmin + tty: true + working_dir: /likeadmin_php/admin + ports: + - "5173:5173"