Reworking the container to use multistage builds. this should hopefully help it build faster
This commit is contained in:
parent
a167357def
commit
3d1a055291
@ -5,7 +5,6 @@ services:
|
||||
command: ["dockerd-entrypoint.sh"]
|
||||
variables:
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
DOCKER_DRIVER: overlay2
|
||||
|
||||
stages:
|
||||
- linting
|
||||
@ -14,7 +13,7 @@ stages:
|
||||
linting:
|
||||
stage: linting
|
||||
before_script:
|
||||
- apk add --no-cache python3 python3-dev build-base docker g++ gcc libxml2-dev libxslt-dev python-dev libffi-dev openssl-dev make
|
||||
- apk add --no-cache python3 python3-dev build-base docker g++ gcc libxml2-dev libxslt-dev libffi-dev openssl-dev make
|
||||
- pip3 install pylint
|
||||
- pip3 install -r app/requirements.txt
|
||||
script:
|
||||
|
@ -1,6 +1,10 @@
|
||||
FROM python:3.6-buster
|
||||
FROM python:3.8 as build
|
||||
RUN apt-get update && apt-get install -y gcc python-pip
|
||||
# RUN apk add --no-cache build-base g++ gcc libxml2-dev libxslt-dev libffi-dev openssl-dev make
|
||||
ADD app/requirements.txt /requirements.txt
|
||||
RUN pip install -U pip && pip install -r requirements.txt
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
FROM python:alpine
|
||||
COPY --from=build /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/
|
||||
ADD app /app
|
||||
CMD python /app/dragon-bot-updated.py
|
||||
|
@ -1,8 +1,7 @@
|
||||
FROM python:3.6-buster
|
||||
RUN apt-get update && apt-get install -y gcc python-pip vim
|
||||
FROM python:3.8 as builder
|
||||
RUN apt-get update && apt-get install -y gcc python-pip
|
||||
ADD app/requirements.txt /requirements.txt
|
||||
RUN pip install -U pip pylint && pip install -r requirements.txt
|
||||
|
||||
RUN pip install -r requirements.txt
|
||||
ADD app /app
|
||||
#RUN printf "\n\nTesting your python code for errors\n\n" && \
|
||||
# pylint -E /app/*.py
|
||||
@ -10,4 +9,4 @@ ADD app /app
|
||||
WORKDIR /app
|
||||
RUN printf "\n#########################\n Run dragon bot by typing \n python dragon-bot.py\n#########################\n\n"
|
||||
|
||||
CMD python /app/dragon-bot.py
|
||||
CMD python /app/dragon-bot-updated.py
|
||||
|
@ -6,5 +6,4 @@ printf "[+] Done\n"
|
||||
printf "\n[-] Running dragon bot in test mode\n"
|
||||
docker build -f ./Dockerfile-test-env -t dragon-bot-test . || exit
|
||||
|
||||
# Run that shit and mount the docker socket so it can talk to the sky-factory container
|
||||
docker run -ti --rm --name dragon-bot-test -e DRAGON_ENV=test -e token="MzQ1MjkwMTI5OTQ4Mjc4Nzg0.DG5IBw._9umb82PrL22bPe7GjmHClU-NtU" -v /var/run/docker.sock:/var/run/docker.sock dragon-bot-test sh
|
||||
|
Loading…
x
Reference in New Issue
Block a user