Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .azure/aci-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ properties:
environmentVariables:
- name: SSH_USERS
value: "{SSH_USERS}"
- name: PRODUCTION
value: "true"
image: undpgeohub.azurecr.io/undp-data/geo-cb-surge:main
ports:
- port: 22
- port: 443
resources:
requests:
cpu: 4
Expand All @@ -28,6 +31,7 @@ properties:
type: Public
ports:
- port: 22
- port: 443
dnsNameLabel: cbsurge-rapida
volumes:
- name: fileshare-volume
Expand Down
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ FROM ghcr.io/osgeo/gdal:ubuntu-full-3.10.0
ARG GROUPNAME="cbsurge"

# Install necessary tools and Python packages
RUN apt-get update && \
apt-get install -y python3-pip pipenv gcc cmake libgeos-dev openssh-server && \
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get update && \
apt-get install -y python3-pip pipenv \
gcc cmake libgeos-dev \
openssh-server \
ca-certificates curl gnupg nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/* && \
npm install -g configurable-http-proxy

# install azure-cli
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ services:
volumes:
- ./create_user.sh:/app/create_user.sh
- ./entrypoint.sh:/app/entrypoint.sh
- ./jupyterhub_config.py:/app/jupyterhub_config.py
- ./Makefile:/app/Makefile
- ./cbsurge:/app/cbsurge # mount app folder to container
- ./tests:/app/tests
entrypoint: "/app/entrypoint.sh"
# entrypoint: "pipenv run jupyterhub"
ports:
- 2222:22
- 8100:8000
environment:
- SSH_USERS=${SSH_USERS:-''}
14 changes: 12 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,15 @@ if [ ! -z "$SSH_USERS" ]; then
done
fi

# launch ssh server
/usr/sbin/sshd -D
# Determine the port based on the PRODUCTION environment variable
if [ "$PRODUCTION" = "true" ]; then
JUPYTER_PORT=443
else
JUPYTER_PORT=8000
fi

# Start SSH server in the background
/usr/sbin/sshd -D &

# Start JupyterLab in the foreground (so the container keeps running)
pipenv run jupyterhub -f jupyterhub_config.py --port=$JUPYTER_PORT
Loading
Loading