-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (25 loc) · 1.07 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
################################################################################
# https://github.com/Fongshway/docker-python/blob/master/Dockerfile
FROM fongshway/python:production
################################################################################
ENV PROJECT_DIR="/opt/twpm" \
PYTHONPATH="${PYTHONPATH}:${PROJECT_DIR}" \
USER=twpm \
TASKWARRIOR_VERSION=2.5.1+dfsg-7
# -- Create non-root user:
RUN useradd -ms /bin/bash ${USER} && \
mkdir -p "${PROJECT_DIR}" && \
chown -R ${USER}: "${PROJECT_DIR}" /usr/local /home/${USER} && \
usermod -aG sudo ${USER} && \
sed -i.bkp -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers
# -- Create application directory:
RUN set -ex && mkdir -p ${PROJECT_DIR}
WORKDIR "${PROJECT_DIR}"
USER ${USER}
# -- Install taskwarrior:
RUN sudo apt-get update && \
sudo apt-get install -y taskwarrior=${TASKWARRIOR_VERSION} && \
sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/* && \
touch /home/twpm/.taskrc
COPY . "${PROJECT_DIR}"
RUN sudo chown -R ${USER}: "${PROJECT_DIR}"