2020-11-14 21:54:29 +00:00
|
|
|
FROM python:3.8-slim AS builder
|
|
|
|
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
ARG BUILD_DATE
|
|
|
|
|
2020-11-16 19:28:10 +00:00
|
|
|
ENV TACTICAL_DIR /opt/tactical
|
2020-11-18 03:55:13 +00:00
|
|
|
ENV TACTICAL_GO_DIR /usr/local/rmmgo
|
2020-11-14 21:54:29 +00:00
|
|
|
ENV TACTICAL_READY_FILE ${TACTICAL_DIR}/tmp/tactical.ready
|
|
|
|
ENV TACTICAL_USER tactical
|
2020-11-18 03:55:13 +00:00
|
|
|
ENV PATH ${TACTICAL_DIR}/api/env/bin:$PATH
|
2020-11-14 21:54:29 +00:00
|
|
|
|
|
|
|
SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"]
|
|
|
|
|
2020-11-18 03:55:13 +00:00
|
|
|
# copy files from repo
|
|
|
|
COPY api/tacticalrmm ${TACTICAL_DIR}/api
|
|
|
|
COPY scripts ${TACTICAL_DIR}/scripts
|
|
|
|
COPY _modules ${TACTICAL_DIR}/_modules
|
|
|
|
COPY api/tacticalrmm/core/goinstaller/bin/goversioninfo /usr/local/bin/goversioninfo
|
2020-11-16 19:28:10 +00:00
|
|
|
|
2020-11-18 03:55:13 +00:00
|
|
|
# install deps
|
2020-11-16 19:28:10 +00:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get upgrade -y && \
|
|
|
|
apt-get install -y --no-install-recommends wget ca-certificates gcc libc6-dev && \
|
|
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
|
|
pip install --upgrade pip && \
|
|
|
|
pip install --no-cache-dir virtualenv && python -m virtualenv ${TACTICAL_DIR}/api/env && \
|
|
|
|
${TACTICAL_DIR}/api/env/bin/pip install --no-cache-dir setuptools wheel gunicorn && \
|
2020-11-18 03:55:13 +00:00
|
|
|
${TACTICAL_DIR}/api/env/bin/pip install --no-cache-dir -r ${TACTICAL_DIR}/api/requirements.txt && \
|
2020-11-16 19:28:10 +00:00
|
|
|
wget https://golang.org/dl/go1.15.linux-amd64.tar.gz -P /tmp && \
|
2020-11-18 03:55:13 +00:00
|
|
|
mkdir -p ${TACTICAL_GO_DIR}/go && \
|
|
|
|
tar -xzf /tmp/go1.15.linux-amd64.tar.gz -C ${TACTICAL_GO_DIR}/go && \
|
|
|
|
rm -f /tmp/go1.15.linux-amd64.tar.gz && \
|
|
|
|
groupadd -g 1000 "${TACTICAL_USER}" && \
|
2020-11-16 19:28:10 +00:00
|
|
|
useradd -M -d "${TACTICAL_DIR}" -s /bin/bash -u 1000 -g 1000 "${TACTICAL_USER}"
|
2020-11-14 21:54:29 +00:00
|
|
|
|
|
|
|
# docker init
|
2020-11-16 19:28:10 +00:00
|
|
|
COPY docker/containers/tactical/entrypoint.sh /
|
|
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
2020-11-14 21:54:29 +00:00
|
|
|
|
2020-11-16 19:28:10 +00:00
|
|
|
WORKDIR ${TACTICAL_DIR}/api
|