修改本地服务

This commit is contained in:
ykxiao 2023-08-04 10:32:07 +08:00
parent 82a135ab58
commit 0d8ff4771d
4 changed files with 86 additions and 14 deletions

View File

@ -3,6 +3,8 @@ networks:
driver: ${NETWORKS_DRIVER} driver: ${NETWORKS_DRIVER}
backend: backend:
driver: ${NETWORKS_DRIVER} driver: ${NETWORKS_DRIVER}
custom_network:
driver: bridge
volumes: volumes:
mysql: mysql:
driver: ${VOLUMES_DRIVER} driver: ${VOLUMES_DRIVER}
@ -194,6 +196,8 @@ services:
- "${WORKSPACE_VUE_CLI_UI_HOST_PORT}:8000" - "${WORKSPACE_VUE_CLI_UI_HOST_PORT}:8000"
- "${WORKSPACE_ANGULAR_CLI_SERVE_HOST_PORT}:4200" - "${WORKSPACE_ANGULAR_CLI_SERVE_HOST_PORT}:4200"
- "${WORKSPACE_VITE_PORT}:5173" - "${WORKSPACE_VITE_PORT}:5173"
- "${TCP_HOST_PORT}:5291"
- "${UDP_HOST_PORT}:5292"
tty: true tty: true
environment: environment:
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG} - PHP_IDE_CONFIG=${PHP_IDE_CONFIG}
@ -203,8 +207,8 @@ services:
- DOCKER_CERT_PATH=/certs/client - DOCKER_CERT_PATH=/certs/client
- CHOKIDAR_USEPOLLING=true - CHOKIDAR_USEPOLLING=true
networks: networks:
- frontend - custom_network
- backend container_name: workspace
links: links:
- docker-in-docker - docker-in-docker
@ -316,7 +320,7 @@ services:
depends_on: depends_on:
- workspace - workspace
networks: networks:
- backend - custom_network
links: links:
- docker-in-docker - docker-in-docker
@ -371,7 +375,7 @@ services:
extra_hosts: extra_hosts:
- "dockerhost:${DOCKER_HOST_IP}" - "dockerhost:${DOCKER_HOST_IP}"
networks: networks:
- backend - custom_network
### Laravel Horizon ############################################ ### Laravel Horizon ############################################
laravel-horizon: laravel-horizon:
build: build:
@ -443,8 +447,7 @@ services:
depends_on: depends_on:
- php-fpm - php-fpm
networks: networks:
- frontend - custom_network
- backend
### OpenResty Server ######################################### ### OpenResty Server #########################################
openresty: openresty:
@ -555,7 +558,7 @@ services:
ports: ports:
- "${MYSQL_PORT}:3306" - "${MYSQL_PORT}:3306"
networks: networks:
- backend - custom_network
### Percona ################################################ ### Percona ################################################
percona: percona:
@ -756,7 +759,8 @@ services:
ports: ports:
- "${REDIS_PORT}:6379" - "${REDIS_PORT}:6379"
networks: networks:
- backend - custom_network
container_name: redis
### Redis Cluster ########################################## ### Redis Cluster ##########################################
redis-cluster: redis-cluster:
@ -858,7 +862,8 @@ services:
depends_on: depends_on:
- php-fpm - php-fpm
networks: networks:
- backend - custom_network
container_name: rabbitmq
### Mercure ############################################# ### Mercure #############################################
mercure: mercure:
@ -1455,7 +1460,8 @@ services:
ports: ports:
- 9010:9000 - 9010:9000
networks: networks:
- backend - custom_network
container_name: portainer
### Gitlab ################################################ ### Gitlab ################################################
gitlab: gitlab:
@ -1487,7 +1493,8 @@ services:
- "${GITLAB_HOST_HTTPS_PORT}:443" - "${GITLAB_HOST_HTTPS_PORT}:443"
- "${GITLAB_HOST_SSH_PORT}:22" - "${GITLAB_HOST_SSH_PORT}:22"
networks: networks:
- backend - custom_network
container_name: gitlab
depends_on: depends_on:
- redis - redis
- postgres - postgres
@ -2136,3 +2143,20 @@ services:
networks: networks:
- frontend - frontend
- backend - backend
### gitea ##################################################
gitea:
build: ./gitea
volumes:
- ./gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
networks:
- custom_network
container_name: gitea
ports:
- "4300:3000"
- "2221:2222"

2
gitea/Dockerfile Normal file
View File

@ -0,0 +1,2 @@
FROM gitea/gitea:latest-rootless
LABEL maintainer="ykxiao <yk_9001@icloud.com>"

View File

@ -0,0 +1,45 @@
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name mes.api.com;
root /var/www/mes-admin-api/public;
index index.php;
location = /index.php {
# Ensure that there is no such file named "not_exists"
# in your "public" directory.
try_files /not_exists @swoole;
}
# any php files must not be accessed
#location ~* \.php$ {
# return 404;
#}
location / {
try_files $uri $uri/ @swoole;
}
location @swoole {
set $suffix "";
if ($uri = /index.php) {
set $suffix ?$query_string;
}
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
# IF https
# proxy_set_header HTTPS "on";
proxy_pass http://workspace:4200$suffix;
}
}

View File

@ -1,8 +1,9 @@
[program:laravel-worker] [program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d process_name=%(program_name)s_%(process_num)02d
command=php /var/www/artisan queue:work --sleep=3 --tries=3 command=php /var/www/mes-admin-api/artisan queue:work --tries=3
autostart=true autostart=true
autorestart=true autorestart=true
numprocs=8 numprocs=3
user=laradock user=root
redirect_stderr=true redirect_stderr=true
stdout_logfile=/var/www/mes-admin-api/storage/logs/laravel-worker.log