🐳 添加 docker 配置.

This commit is contained in:
lijiahangmax
2024-02-25 17:44:21 +08:00
parent 115ed7e6c5
commit c3f33e7494
9 changed files with 28 additions and 19 deletions

View File

@@ -23,3 +23,7 @@ collation_server=utf8mb4_general_ci
default-storage-engine=InnoDB
# 禁止 DNS 解析
skip-name-resolve
# 默认加密方式
default_authentication_plugin=mysql_native_password
# sql模式
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

View File

@@ -1,5 +1,10 @@
FROM nginx:alpine
USER root
RUN \
echo "" > /etc/apk/repositories && \
echo "http://mirrors.aliyun.com/alpine/v3.8/main" >> /etc/apk/repositories &&\
echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories && \
apk update
RUN apk add openjdk8
RUN rm -rf /etc/nginx/conf.d/*
WORKDIR /app

View File

@@ -1,4 +1,4 @@
#!/bin/bash
nginx
cd /app
java -jar app.jar --spring.profiles.active=prod
nohup java -jar app.jar --spring.profiles.active=prod 2>&1 &
nginx -g 'daemon off;'