-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from hq002/docker
Docker
- Loading branch information
Showing
8 changed files
with
555 additions
and
675 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
dist/ | ||
*.log |
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,4 +1,4 @@ | ||
[submodule "radishes-v2"] | ||
path = packages/api | ||
url = git@github.com:radishes-music/NeteaseCloudMusicApi.git | ||
url = https://github.com/radishes-music/NeteaseCloudMusicApi.git | ||
branch = radishes |
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,12 @@ | ||
# 阶段一: 构建 | ||
FROM node:18 AS build | ||
WORKDIR /app | ||
COPY . . | ||
RUN YARN_IGNORE_SCRIPTS=1 yarn | ||
RUN yarn build:web | ||
|
||
# 阶段二: 设置 Nginx | ||
FROM nginx:latest | ||
# 注意:你可能需要根据你的 Nginx 配置和构建的输出修改以下这行 | ||
COPY --from=build /app/dist /usr/share/nginx/html | ||
COPY nginx.conf /etc/nginx/conf.d/default.conf |
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,15 @@ | ||
services: | ||
|
||
nginx: | ||
build: # 这是你的 Nginx Dockerfile 所在的位置 | ||
context: . | ||
dockerfile: Dockerfile | ||
depends_on: | ||
- node | ||
ports: | ||
- "1234:80" | ||
|
||
node: | ||
build: ./packages/api | ||
ports: | ||
- "32768:32768" |
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,16 @@ | ||
server { | ||
listen 80; | ||
location / { | ||
root /usr/share/nginx/html; | ||
try_files $uri $uri/ =404; | ||
} | ||
|
||
location /api/ { | ||
proxy_pass http://node:32768/; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'upgrade'; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
} |
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
Oops, something went wrong.