Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
965ca365
Unverified
Commit
965ca365
authored
Jan 29, 2024
by
Bowen Liang
Committed by
GitHub
Jan 29, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use pm2 to guard and monitor the web service in docker file (#2238)
parent
b4988ce2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
12 deletions
+16
-12
Dockerfile
web/Dockerfile
+5
-0
entrypoint.sh
web/docker/entrypoint.sh
+1
-1
pm2.json
web/docker/pm2.json
+10
-11
No files found.
web/Dockerfile
View file @
965ca365
...
@@ -40,12 +40,17 @@ ENV TZ UTC
...
@@ -40,12 +40,17 @@ ENV TZ UTC
RUN
ln
-s
/usr/share/zoneinfo/
${
TZ
}
/etc/localtime
\
RUN
ln
-s
/usr/share/zoneinfo/
${
TZ
}
/etc/localtime
\
&&
echo
${
TZ
}
>
/etc/timezone
&&
echo
${
TZ
}
>
/etc/timezone
# global runtime packages
RUN
yarn global add pm2
\
&&
yarn cache clean
WORKDIR
/app/web
WORKDIR
/app/web
COPY
--from=builder /app/web/public ./public
COPY
--from=builder /app/web/public ./public
COPY
--from=builder /app/web/.next/standalone ./
COPY
--from=builder /app/web/.next/standalone ./
COPY
--from=builder /app/web/.next/static ./.next/static
COPY
--from=builder /app/web/.next/static ./.next/static
COPY
docker/pm2.json ./pm2.json
COPY
docker/entrypoint.sh ./entrypoint.sh
COPY
docker/entrypoint.sh ./entrypoint.sh
ARG
COMMIT_SHA
ARG
COMMIT_SHA
...
...
web/docker/entrypoint.sh
View file @
965ca365
...
@@ -10,4 +10,4 @@ export NEXT_PUBLIC_PUBLIC_API_PREFIX=${APP_API_URL}/api
...
@@ -10,4 +10,4 @@ export NEXT_PUBLIC_PUBLIC_API_PREFIX=${APP_API_URL}/api
export
NEXT_PUBLIC_SENTRY_DSN
=
${
SENTRY_DSN
}
export
NEXT_PUBLIC_SENTRY_DSN
=
${
SENTRY_DSN
}
export
NEXT_PUBLIC_SITE_ABOUT
=
${
SITE_ABOUT
}
export
NEXT_PUBLIC_SITE_ABOUT
=
${
SITE_ABOUT
}
node ./server.js
pm2 start ./pm2.json
--no-daemon
web/docker/pm2.json
View file @
965ca365
{
{
"apps"
:
[
"apps"
:
[
{
{
"name"
:
"WebApp"
,
"name"
:
"dify-web"
,
"exec_mode"
:
"cluster"
,
"script"
:
"/app/web/server.js"
,
"instances"
:
1
,
"script"
:
"./node_modules/next/dist/bin/next"
,
"cwd"
:
"/app/web"
,
"cwd"
:
"/app/web"
,
"args"
:
"start"
"exec_mode"
:
"cluster"
,
"instances"
:
2
}
}
]
]
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment