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
b0d4c25d
Commit
b0d4c25d
authored
Aug 06, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Plain Diff
optimize web dockerfile
parents
fcd596c3
f749107a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
18 deletions
+21
-18
README.md
api/README.md
+1
-1
Dockerfile
web/Dockerfile
+17
-14
pm2.json
web/docker/pm2.json
+2
-3
next.config.js
web/next.config.js
+1
-0
No files found.
api/README.md
View file @
b0d4c25d
...
...
@@ -8,7 +8,7 @@
```bash
cd ../docker
docker-compose -f docker-compose.middleware.yaml up -d
docker-compose -f docker-compose.middleware.yaml
-p dify
up -d
cd ../api
```
2.
Copy
`.env.example`
to
`.env`
...
...
web/Dockerfile
View file @
b0d4c25d
FROM
node:18.17.0-alpine
FROM
node:18.17.0-alpine AS base
FROM
base AS deps
WORKDIR
/app/web
COPY
package.json ./package.json
RUN
npm
install
--only
=
prod
LABEL
maintainer="takatost@gmail.com"
FROM
base AS builder
WORKDIR
/app/web
COPY
--from=deps /app/web/node_modules ./node_modules
COPY
. .
RUN
npm run build
FROM
base AS runner
LABEL
maintainer="takatost@gmail.com"
ENV
NODE_ENV=production
ENV
EDITION SELF_HOSTED
ENV
DEPLOY_ENV PRODUCTION
ENV
CONSOLE_API_URL http://127.0.0.1:5001
ENV
APP_API_URL http://127.0.0.1:5001
EXPOSE
3000
WORKDIR
/app/web
COPY
package.json /app/web/package.json
RUN
npm
install
pm2
-g
WORKDIR
/app/web
COPY
--from=builder /app/web/public ./public
COPY
--from=builder /app/web/.next/standalone ./
COPY
--from=builder /app/web/.next/static ./.next/static
RUN
npm
install
--only
=
prod
COPY
. /app/web/
RUN
npm run build
EXPOSE
3000
COPY
docker/pm2.json /app/web/pm2.json
COPY
docker/entrypoint.sh /entrypoint.sh
...
...
web/docker/pm2.json
View file @
b0d4c25d
...
...
@@ -4,9 +4,8 @@
"name"
:
"WebApp"
,
"exec_mode"
:
"cluster"
,
"instances"
:
1
,
"script"
:
"./node_modules/next/dist/bin/next"
,
"cwd"
:
"/app/web"
,
"args"
:
"start"
"script"
:
"./server.js"
,
"cwd"
:
"/app/web"
}
]
}
web/next.config.js
View file @
b0d4c25d
...
...
@@ -29,6 +29,7 @@ const nextConfig = {
// https://nextjs.org/docs/api-reference/next.config.js/ignoring-typescript-errors
ignoreBuildErrors
:
true
,
},
output
:
'standalone'
,
async
redirects
()
{
return
[
{
...
...
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