Skip to content

Commit

Permalink
update hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
dafengzhen committed Mar 17, 2024
1 parent 5ed3ade commit d8e67f7
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 8 deletions.
36 changes: 36 additions & 0 deletions hosting/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Image
TAG=dev

# profile (The value of profile can be dev or not)
PROFILES_ACTIVE=

# Database
DATABASE_USERNAME=root
DATABASE_PASSWORD=123456

# Application url
URL=http://localhost:3000

# Application name
NAME=Youdeyiwu

# Application description
DESCRIPTION=Youdeyiwu is an open-source lightweight forum

# Interface address
API_SERVER=http://localhost:8080

# Is it an HTTPS site
IS_HTTPS_SITE=false

# Allowed source domain(s) for sending requests, multiple domains separated by commas
SERVER_ACTIONS_ALLOWED_ORIGINS=

# Set the remotePatterns to allow images, in the format of an array
# IMAGES_REMOTE_PATTERNS_0_PROTOCOL=https
# IMAGES_REMOTE_PATTERNS_0_HOSTNAME=example.com
# IMAGES_REMOTE_PATTERNS_0_PORT=
# IMAGES_REMOTE_PATTERNS_0_PATHNAME=**

# Other
SHOW_FOOTER=true
2 changes: 2 additions & 0 deletions hosting/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# hosting

The docker-compose.yml file in this directory can quickly deploy the frontend and backend of the project, providing a similar experience to a testing environment.

If you need to deploy it in a production environment, you will need to modify the relevant parameters according to the requirements.
62 changes: 54 additions & 8 deletions hosting/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,75 @@ version: "3"
services:
youdeyiwu:
labels:
- "description=Build Youdeyiwu backend application"
- maintainer=dafengzhen
- description=Run youdeyiwu backend application
container_name: youdeyiwu
build:
context: ../
image: dafengzhen/youdeyiwu
environment:
- TAG
- PROFILES_ACTIVE
- DATABASE_ENDPOINT=youdeyiwu:3306
- DATABASE_USERNAME
- DATABASE_PASSWORD
depends_on:
- youdeyiwu-db
restart: on-failure
volumes:
- logs:/youdeyiwu/logs
ports:
- "8080:8080"
networks:
- youdeyiwu

youdeyiwu-web:
labels:
- "description=Build Youdeyiwu frontend application"
- maintainer=dafengzhen
- description=Build youdeyiwu frontend application
container_name: youdeyiwu-web
build:
context: ../web
image: dafengzhen/youdeyiwu-web
environment:
- TAG
- URL
- NAME
- DESCRIPTION
- API_SERVER=http://youdeyiwu:8080
- IS_HTTPS_SITE
- SERVER_ACTIONS_ALLOWED_ORIGINS
- SHOW_FOOTER
- IMAGES_REMOTE_PATTERNS_0_PROTOCOL
- IMAGES_REMOTE_PATTERNS_0_HOSTNAME
- IMAGES_REMOTE_PATTERNS_0_PORT
- IMAGES_REMOTE_PATTERNS_0_PATHNAME
depends_on:
- youdeyiwu
restart: on-failure
ports:
- "3000:3000"
networks:
- youdeyiwu
- youdeyiwu-web

youdeyiwu-db:
labels:
- maintainer=dafengzhen
- description=Build youdeyiwu database application
container_name: youdeyiwu-db
image: 'mysql:8.2'
restart: on-failure
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=123456
ports:
- '3306:3306'
networks:
- youdeyiwu

networks:
youdeyiwu:
youdeyiwu-web:
name: youdeyiwu

volumes:
logs:
name: youdeyiwu_logs
db:
name: youdeyiwu_db
5 changes: 5 additions & 0 deletions web/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ services:
container_name: youdeyiwu-web
image: "youdeyiwu-web:${TAG}"
environment:
- TAG
- URL
- NAME
- DESCRIPTION
- API_SERVER
- IS_HTTPS_SITE
- SERVER_ACTIONS_ALLOWED_ORIGINS
- SHOW_FOOTER
- IMAGES_REMOTE_PATTERNS_0_PROTOCOL
- IMAGES_REMOTE_PATTERNS_0_HOSTNAME
- IMAGES_REMOTE_PATTERNS_0_PORT
- IMAGES_REMOTE_PATTERNS_0_PATHNAME
build:
context: .
networks:
Expand Down

0 comments on commit d8e67f7

Please sign in to comment.