forked from wagov/siem-query-utils
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.appservice
36 lines (28 loc) · 1.56 KB
/
Dockerfile.appservice
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM --platform=linux/amd64 jupyter/datascience-notebook:python-3.10
LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/wagov/siem-query-utils"
USER root
RUN cp -r /home/jovyan /root
# Debian pkgs setup
RUN curl -sL https://quarto.org/download/latest/quarto-linux-amd64.deb -o /tmp/quarto.deb \
&& apt-get -y update && apt-get -y --no-install-recommends install weasyprint wkhtmltopdf dialog openssh-server /tmp/quarto.deb \
&& apt-get -y full-upgrade && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/quarto.deb
# Copy over python project
COPY . /app
WORKDIR /app
# Configure SSH for [Azure App Service](https://learn.microsoft.com/en-us/azure/app-service/configure-custom-container?tabs=debian&pivots=container-linux#enable-ssh)
# Also setup bash to try and import session env when logging in via ssh
RUN echo 'root:Docker!' | chpasswd
RUN cat appservice/sshd_config > /etc/sshd_config
RUN cat /home/jovyan/.bashrc appservice/.bashrc > /root/.bashrc
# Setup conda env and activate
SHELL ["/bin/bash", "-l", "-c"]
# Install python project, azure cli extensions and npm subproject
RUN pip install --quiet --no-cache-dir .
RUN az extension add -n log-analytics -y
# chown is to fix odd high uids from npm install
RUN npm --quiet clean-install . && chown -R root:root ./node_modules
EXPOSE 8000 2222
ENV KILL_PLACEHOLDER true
# Start SSH, serve a placeholder server and start the siem_query_utils server
ENTRYPOINT ["/bin/bash", "-l", "-c", "service ssh start; python -m http.server & siem_query_utils serve"]