-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue-119] Clean up docker build for api-engine
The current building process involves several useless steps. And it will trigger security alerts with the old version of django packages. This PR cleans unused code and remove unused scripts and packages. Close#119. Signed-off-by: Baohua Yang <[email protected]>
- Loading branch information
Showing
8 changed files
with
40 additions
and
154 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
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,20 +1,25 @@ | ||
FROM python:3.6 | ||
|
||
RUN apt-get update && apt-get install -y gettext-base graphviz libgraphviz-dev && \ | ||
apt-get autoclean && apt-get clean && apt-get autoremove && rm -rf /var/cache/apt/ | ||
COPY src/api-engine/requirements.txt / | ||
RUN cd / && \ | ||
pip install -r requirements.txt | ||
# Install software | ||
RUN apt-get update \ | ||
&& apt-get install -y gettext-base graphviz libgraphviz-dev \ | ||
&& apt-get autoclean \ | ||
&& apt-get clean \ | ||
&& apt-get autoremove && rm -rf /var/cache/apt/ | ||
|
||
COPY src/api-engine /var/www/server | ||
COPY src/api-engine/docker/uwsgi/server.ini /etc/uwsgi/apps-enabled/ | ||
COPY src/api-engine/docker/scripts /scripts | ||
COPY build_image/docker/common/api-engine/entrypoint.sh / | ||
# Set the working dir | ||
WORKDIR /var/www/server | ||
|
||
RUN cd /var/www/server/api_engine && cp settings.py.initial settings.py && cd .. && python manage.py collectstatic --noinput | ||
# Copy source code to the working dir | ||
COPY src/api-engine ./ | ||
|
||
WORKDIR /var/www/server | ||
# Install python dependencies | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Add uwsgi configuration file | ||
COPY build_image/docker/common/api-engine/server.ini /etc/uwsgi/apps-enabled/ | ||
|
||
ENV RUN_MODE server | ||
|
||
COPY build_image/docker/common/api-engine/entrypoint.sh / | ||
CMD bash /entrypoint.sh |
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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