-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
38 lines (32 loc) · 1.19 KB
/
Dockerfile
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
37
38
# Dockerfile for https://github.com/kapoorlab/NapaTrackMater
# Author: NicolasCARPi https://github.com/NicolasCARPi/
# start with the debian version, not alpine as it causes many issues
FROM python:3.9-slim-buster
# create a user instead of using root user
RUN useradd -mls /bin/bash worker
# this is required by dependencies
RUN apt-get update \
&& apt-get install -y libglib2.0-dev libgl1-mesa-glx python3-fontconfig \
&& rm -rf /var/lib/apt/lists/*
# set some python/pip env vars, adjust PATH
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
PYTHONPATH=/home/worker/lib/python \
PATH=/home/worker/.local/bin:${PATH} \
DEBIAN_FRONTEND=noninteractive
WORKDIR /usr/src/app
RUN chown worker:worker .
USER worker
COPY requirements.txt .
RUN pip install -vv --no-cache-dir --prefer-binary --user -r requirements.txt
# chown is necessary or everything will be root owned
COPY --chown=worker:worker . .
# install the package
RUN python setup.py develop --user
# default command just shows the help
CMD ["track", "-h"]