-
Notifications
You must be signed in to change notification settings - Fork 786
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2705-upgrade-island-python-version' into develop
- Loading branch information
Showing
6 changed files
with
248 additions
and
280 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
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,28 +1,35 @@ | ||
# Install python dependencies using the bitnami/python:3.7 image, which includes | ||
# development dependencies. | ||
FROM bitnami/python:3.7 as builder | ||
ARG PYTHON_VERSION=3.11 | ||
# Install python and some build dependencies | ||
FROM python:$PYTHON_VERSION-slim as builder | ||
COPY ./monkey /monkey | ||
WORKDIR /monkey | ||
RUN virtualenv . | ||
RUN export CI=1 | ||
RUN . bin/activate && \ | ||
cd monkey_island && \ | ||
pip install pipenv==2022.7.4 && \ | ||
pipenv sync | ||
RUN apt-get update && apt-get install -y gcc \ | ||
&& python -m venv . \ | ||
&& export CI=1 \ | ||
&& . bin/activate \ | ||
&& pip install -U pip \ | ||
&& cd monkey_island \ | ||
&& pip install pipenv \ | ||
&& pipenv sync | ||
|
||
|
||
# Build the final application using the bitnami/python:3.7-prod image, which | ||
# Build the final application using a second image, which | ||
# does not include development dependencies. | ||
FROM bitnami/python:3.7-prod | ||
RUN apt-get update && apt-get install -y iputils-ping && apt-get clean | ||
FROM python:$PYTHON_VERSION-slim | ||
COPY --from=builder /monkey /monkey | ||
WORKDIR /monkey | ||
EXPOSE 5000 | ||
ENV MONKEY_DOCKER_CONTAINER=true | ||
RUN groupadd -r monkey-island && useradd --no-log-init -r -g monkey-island monkey-island | ||
RUN chmod 444 /monkey/monkey_island/cc/server.key | ||
RUN chmod 444 /monkey/monkey_island/cc/server.csr | ||
RUN chmod 444 /monkey/monkey_island/cc/server.crt | ||
RUN mkdir /monkey_island_data && chmod 700 /monkey_island_data && chown -R monkey-island:monkey-island /monkey_island_data | ||
RUN apt-get update \ | ||
&& apt-get install -y iputils-ping \ | ||
&& apt-get clean \ | ||
&& groupadd -r monkey-island \ | ||
&& useradd --no-log-init -r -g monkey-island monkey-island \ | ||
&& chmod 444 /monkey/monkey_island/cc/server.key \ | ||
&& chmod 444 /monkey/monkey_island/cc/server.csr \ | ||
&& chmod 444 /monkey/monkey_island/cc/server.crt \ | ||
&& mkdir /monkey_island_data \ | ||
&& chmod 700 /monkey_island_data \ | ||
&& chown -R monkey-island:monkey-island /monkey_island_data | ||
USER monkey-island | ||
ENTRYPOINT ["/monkey/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
Oops, something went wrong.