aboutsummaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/Dockerfile2
-rw-r--r--docker/base.Dockerfile55
-rw-r--r--docker/venv.Dockerfile20
3 files changed, 1 insertions, 76 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 693da6e..ea05c5c 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -34,8 +34,8 @@ COPY --from=builder /nsjail/nsjail /usr/sbin/
RUN chmod +x /usr/sbin/nsjail
FROM base as venv
-
ARG DEV
+
ENV PIP_NO_CACHE_DIR=false \
PIPENV_DONT_USE_PYENV=1 \
PIPENV_HIDE_EMOJIS=1 \
diff --git a/docker/base.Dockerfile b/docker/base.Dockerfile
deleted file mode 100644
index 1655aa1..0000000
--- a/docker/base.Dockerfile
+++ /dev/null
@@ -1,55 +0,0 @@
-FROM python:3.9-slim-buster as builder
-RUN apt-get -y update \
- && apt-get install -y \
- bison=2:3.3.* \
- flex=2.6.* \
- g++=4:8.3.* \
- gcc=4:8.3.* \
- git=1:2.20.* \
- libprotobuf-dev=3.6.* \
- libnl-route-3-dev=3.4.* \
- make=4.2.* \
- pkg-config=0.29-6 \
- protobuf-compiler=3.6.*
-RUN git clone \
- -b '2.9' \
- --single-branch \
- --depth 1 \
- https://github.com/google/nsjail.git /nsjail
-WORKDIR /nsjail
-RUN make
-
-FROM python:3.9-slim-buster as venv
-ENV PIP_NO_CACHE_DIR=false
-
-RUN apt-get -y update \
- && apt-get install -y \
- gcc=4:8.3.* \
- libnl-route-3-200=3.4.* \
- libprotobuf17=3.6.* \
- && rm -rf /var/lib/apt/lists/*
-RUN pip install pipenv==2020.11.4
-
-COPY --from=builder /nsjail/nsjail /usr/sbin/
-RUN chmod +x /usr/sbin/nsjail
-
-FROM venv
-
-ARG DEV
-ENV PIP_NO_CACHE_DIR=false \
- PIPENV_DONT_USE_PYENV=1 \
- PIPENV_HIDE_EMOJIS=1 \
- PIPENV_NOSPIN=1
-
-COPY Pipfile Pipfile.lock /snekbox/
-WORKDIR /snekbox
-
-RUN if [ -n "${DEV}" ]; \
- then \
- pipenv install --deploy --system --dev; \
- else \
- pipenv install --deploy --system; \
- fi
-
-# At the end to avoid re-installing dependencies when only a config changes.
-COPY config/ /snekbox/config
diff --git a/docker/venv.Dockerfile b/docker/venv.Dockerfile
deleted file mode 100644
index 27932cd..0000000
--- a/docker/venv.Dockerfile
+++ /dev/null
@@ -1,20 +0,0 @@
-FROM ghcr.io/python-discord/snekbox-base:latest
-
-ARG DEV
-ENV PIP_NO_CACHE_DIR=false \
- PIPENV_DONT_USE_PYENV=1 \
- PIPENV_HIDE_EMOJIS=1 \
- PIPENV_NOSPIN=1
-
-COPY Pipfile Pipfile.lock /snekbox/
-WORKDIR /snekbox
-
-RUN if [ -n "${DEV}" ]; \
- then \
- pipenv install --deploy --system --dev; \
- else \
- pipenv install --deploy --system; \
- fi
-
-# At the end to avoid re-installing dependencies when only a config changes.
-COPY config/ /snekbox/config