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
c9194ba3
Unverified
Commit
c9194ba3
authored
Sep 01, 2023
by
Rhon Joe
Committed by
GitHub
Sep 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(api): api image multistage build (#1069)
parent
a199fa63
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
Dockerfile
api/Dockerfile
+17
-7
No files found.
api/Dockerfile
View file @
c9194ba3
FROM
python:3.10-slim
# packages install stage
FROM
python:3.10-slim AS base
LABEL
maintainer="takatost@gmail.com"
LABEL
maintainer="takatost@gmail.com"
RUN
apt-get update
\
&& apt-get install -y --no-install-recommends gcc g++ python3-dev libc-dev libffi-dev
COPY
requirements.txt /requirements.txt
RUN
pip
install
--prefix
=
/pkg
-r
requirements.txt
# build stage
FROM
python:3.10-slim AS builder
ENV
FLASK_APP app.py
ENV
FLASK_APP app.py
ENV
EDITION SELF_HOSTED
ENV
EDITION SELF_HOSTED
ENV
DEPLOY_ENV PRODUCTION
ENV
DEPLOY_ENV PRODUCTION
...
@@ -15,13 +26,12 @@ EXPOSE 5001
...
@@ -15,13 +26,12 @@ EXPOSE 5001
WORKDIR
/app/api
WORKDIR
/app/api
RUN
apt-get update
&&
\
RUN
apt-get update
\
apt-get
install
-y
bash curl wget vim gcc g++ python3-dev libc-dev libffi-dev nodejs
&& apt-get install -y --no-install-recommends bash curl wget vim nodejs \
&& apt-get autoremove \
COPY
requirements.txt /app/api/requirements.txt
&& rm -rf /var/lib/apt/lists/*
RUN
pip
install
-r
requirements.txt
COPY
--from=base /pkg /usr/local
COPY
. /app/api/
COPY
. /app/api/
COPY
docker/entrypoint.sh /entrypoint.sh
COPY
docker/entrypoint.sh /entrypoint.sh
...
...
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