diff --git a/docker/.dockerignore b/docker/.dockerignore new file mode 100644 index 000000000..dd449725e --- /dev/null +++ b/docker/.dockerignore @@ -0,0 +1 @@ +*.md diff --git a/docker/Dockerfile b/docker/Dockerfile index 6cd945d70..2d0d0b55b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,19 +1,24 @@ -FROM debian:jessie-slim +FROM debian:stretch-slim LABEL MAINTAINER="theonlydoo " +ARG RELEASE=1.6 +ARG DEBIAN_FRONTEND=noninteractive + +EXPOSE 5000 + WORKDIR /app -ADD https://github.com/guardicore/monkey/releases/download/1.5.2/infection_monkey_1.5.2_deb.tgz . +ADD https://github.com/guardicore/monkey/releases/download/${RELEASE}/infection_monkey_deb.${RELEASE}.tgz . -RUN tar xvf infection_monkey_1.5.2_deb.tgz \ - && apt-get -yqq update \ - && apt-get -yqq upgrade \ - && apt-get -yqq install python-pip \ - libssl-dev \ - supervisor \ - && dpkg -i *.deb +RUN tar xvf infection_monkey_deb.${RELEASE}.tgz \ + && apt-get -yqq update \ + && apt-get -yqq upgrade \ + && apt-get -yqq install python-pip \ + python-dev \ + && dpkg -i *.deb \ + && rm -f *.deb *.tgz -COPY stack.conf /etc/supervisor/conf.d/stack.conf - -ENTRYPOINT [ "supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf" ] \ No newline at end of file +WORKDIR /var/monkey +ENTRYPOINT ["/var/monkey/monkey_island/bin/python/bin/python"] +CMD ["/var/monkey/monkey_island.py"] diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 000000000..94a81b00e --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.3' + +services: + db: + image: mongo:4 + restart: always + volumes: + - db_data:/data/db + environment: + MONGO_INITDB_DATABASE: monkeyisland + monkey: + depends_on: + - db + build: . + image: monkey:latest + ports: + - "5000:5000" + environment: + MONGO_URL: mongodb://db:27017/monkeyisland + +volumes: + db_data: diff --git a/docker/stack.conf b/docker/stack.conf deleted file mode 100644 index b742c0392..000000000 --- a/docker/stack.conf +++ /dev/null @@ -1,4 +0,0 @@ -[program:mongod] -command=/var/monkey_island/bin/mongodb/bin/mongod --quiet --dbpath /var/monkey_island/db -[program:monkey] -command=/var/monkey_island/ubuntu/systemd/start_server.sh