-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: runing with docker compose (#8)
- Loading branch information
Showing
11 changed files
with
157 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
version: "3.1" | ||
services: | ||
guess-mysql: | ||
build: docs/mysql | ||
image: guess/mysql | ||
command: --default-authentication-plugin=mysql_native_password | ||
environment: | ||
MYSQL_ROOT_PASSWORD: root | ||
ports: | ||
- "3316:3306" | ||
volumes: | ||
- data-mysql:/var/lib/mysql | ||
|
||
guess-service: | ||
build: service/guess | ||
image: guess/service | ||
depends_on: | ||
guess-mysql: | ||
condition: service_started | ||
environment: | ||
JAVA_OPTS: > | ||
-Xss512k | ||
-XX:MaxRAM=260m | ||
-Dspring.profiles.active=local | ||
-Dspring.datasource.password=root | ||
-Dcore.url.db-mysql=jdbc:mysql://guess-mysql/guess?allowPublicKeyRetrieval=true&useSSL=false | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- data-app:/app/guess | ||
|
||
volumes: | ||
data-app: | ||
data-mysql: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM mysql:8.2.0 | ||
|
||
COPY mysql.cnf /etc/mysql/mysql.conf.d/mysql.cnf | ||
COPY init.sql /docker-entrypoint-initdb.d/init.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE DATABASE IF NOT EXISTS `guess` COLLATE utf8mb4_unicode_ci; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[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 | ||
|
||
#### These optimize the memory use of MySQL | ||
#### http://www.tocker.ca/2014/03/10/configuring-mysql-to-use-minimal-memory.html | ||
innodb_buffer_pool_size=32M | ||
innodb_log_buffer_size=512K | ||
|
||
#### from https://mariadb.com/de/node/579 | ||
performance_schema = off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM openjdk:21-jdk | ||
|
||
RUN rm -f /etc/localtime && \ | ||
ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ | ||
echo "Asia/Shanghai" > /etc/timezone | ||
|
||
ADD ./build/libs/guess-service.jar /opt/app/ | ||
CMD java $JAVA_OPTS -jar /opt/app/guess-service.jar | ||
|
||
EXPOSE 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
core: | ||
jwt-secret: test-jwt-secret | ||
url: | ||
db-mysql: jdbc:mysql://127.0.0.1:3306/guess | ||
weapp: | ||
app-id: fake-app-id | ||
app-secret: fake-app-secret | ||
|
||
spring: | ||
datasource: | ||
username: root | ||
password: root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters