diff --git a/.dockerignore b/.dockerignore index a3f4ac4..adc0e25 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,12 +4,22 @@ # ignore hidden files .* +# Dockerfile +Dockerfile +*.dockerfile + # ignore directories docs/ tests/ # ignore venv when building locally +.venv/ venv/ +# python +*.egg-info/ +build/ + data/ +junit.xml sample.env diff --git a/Dockerfile b/Dockerfile index efc0df7..4793cca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,26 +14,28 @@ ENV BUILD_VERSION=${BUILD_VERSION} ENV COMMIT=${COMMIT} SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# install dependencies -RUN <<_DEPS -#!/bin/bash -set -e -apt-get update -y -apt-get install -y --no-install-recommends \ - git -apt-get clean -rm -rf /var/lib/apt/lists/* -_DEPS VOLUME /data - WORKDIR /app/ -COPY . . +# Copy only necessary files for installation and runtime +COPY pyproject.toml . +COPY src/ src/ +COPY assets/ assets/ + RUN <<_SETUP #!/bin/bash set -e +# install system dependencies +apt-get update -y +apt-get install -y --no-install-recommends git +apt-get clean +rm -rf /var/lib/apt/lists/* + +# create non-root user +useradd -m -u 1000 -s /bin/bash supportbot + # write the version to the version file cat > src/common/version.py < src/common/version.py <