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
5b06ded0
Unverified
Commit
5b06ded0
authored
Aug 17, 2023
by
Matri
Committed by
GitHub
Aug 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: improve dockerfile (#851)
Co-authored-by:
MatriQi
<
matri@aifi.io
>
parent
155a4733
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
5828 additions
and
19 deletions
+5828
-19
.gitignore
sdks/nodejs-client/.gitignore
+0
-1
.gitignore
web/.gitignore
+0
-1
Dockerfile
web/Dockerfile
+31
-15
entrypoint.sh
web/docker/entrypoint.sh
+1
-2
next.config.js
web/next.config.js
+1
-0
yarn.lock
web/yarn.lock
+5795
-0
No files found.
sdks/nodejs-client/.gitignore
View file @
5b06ded0
...
@@ -42,7 +42,6 @@ package-lock.json
...
@@ -42,7 +42,6 @@ package-lock.json
.pnp.cjs
.pnp.cjs
.pnp.loader.mjs
.pnp.loader.mjs
.yarn/
.yarn/
yarn.lock
.yarnrc.yml
.yarnrc.yml
# pmpm
# pmpm
...
...
web/.gitignore
View file @
5b06ded0
...
@@ -42,7 +42,6 @@ package-lock.json
...
@@ -42,7 +42,6 @@ package-lock.json
.pnp.cjs
.pnp.cjs
.pnp.loader.mjs
.pnp.loader.mjs
.yarn/
.yarn/
yarn.lock
.yarnrc.yml
.yarnrc.yml
# pmpm
# pmpm
...
...
web/Dockerfile
View file @
5b06ded0
FROM
node:18.17.0-alpine
# base image
FROM
node:18.17.0-alpine AS base
# install packages
FROM
base as packages
LABEL
maintainer="takatost@gmail.com"
LABEL
maintainer="takatost@gmail.com"
WORKDIR
/app/web
COPY
package.json .
COPY
yarn.lock .
RUN
yarn
--only
=
prod
# build resources
FROM
base as builder
WORKDIR
/app/web
COPY
--from=packages /app/web/ .
COPY
. .
RUN
yarn build
# production stage
FROM
base as production
ENV
NODE_ENV=production
ENV
NODE_ENV=production
ENV
EDITION SELF_HOSTED
ENV
EDITION SELF_HOSTED
ENV
DEPLOY_ENV PRODUCTION
ENV
DEPLOY_ENV PRODUCTION
ENV
CONSOLE_API_URL http://127.0.0.1:5001
ENV
CONSOLE_API_URL http://127.0.0.1:5001
ENV
APP_API_URL http://127.0.0.1:5001
ENV
APP_API_URL http://127.0.0.1:5001
ENV
PORT 3000
EXPOSE
3000
WORKDIR
/app/web
WORKDIR
/app/web
COPY
--from=builder /app/web/.next/standalone ./
COPY
--from=builder /app/web/.next/static ./.next/static
COPY
package.json /app/web/package.json
RUN
npm
install
pm2
-g
RUN
npm
install
--only
=
prod
COPY
docker/entrypoint.sh ./entrypoint.sh
RUN
chmod
+x ./entrypoint.sh
COPY
. /app/web/
RUN
npm run build
COPY
docker/pm2.json /app/web/pm2.json
COPY
docker/entrypoint.sh /entrypoint.sh
RUN
chmod
+x /entrypoint.sh
ARG
COMMIT_SHA
ARG
COMMIT_SHA
ENV
COMMIT_SHA ${COMMIT_SHA}
ENV
COMMIT_SHA ${COMMIT_SHA}
ENTRYPOINT
["/bin/sh", "/entrypoint.sh"]
EXPOSE
3000
ENTRYPOINT
["/bin/sh", "./entrypoint.sh"]
\ No newline at end of file
web/docker/entrypoint.sh
View file @
5b06ded0
...
@@ -19,5 +19,4 @@ fi
...
@@ -19,5 +19,4 @@ fi
export
NEXT_PUBLIC_SENTRY_DSN
=
${
SENTRY_DSN
}
export
NEXT_PUBLIC_SENTRY_DSN
=
${
SENTRY_DSN
}
/usr/local/bin/pm2
-v
node ./server.js
/usr/local/bin/pm2-runtime start /app/web/pm2.json
\ No newline at end of file
web/next.config.js
View file @
5b06ded0
...
@@ -38,6 +38,7 @@ const nextConfig = {
...
@@ -38,6 +38,7 @@ const nextConfig = {
},
},
]
]
},
},
output
:
'standalone'
,
}
}
module
.
exports
=
withMDX
(
nextConfig
)
module
.
exports
=
withMDX
(
nextConfig
)
web/yarn.lock
0 → 100644
View file @
5b06ded0
This diff is collapsed.
Click to expand it.
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