forked from latenighttales/alcali
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (26 loc) · 911 Bytes
/
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
39
FROM python:3.7-slim-stretch
MAINTAINER Matt Melquiond
# Used in travis
ARG USER_ID=1000
# Upgrade System and Install dependencies
RUN apt-get update \
&& seq 1 8 | xargs -I{} mkdir -p /usr/share/man/man{} \
&& apt-get install -y --no-install-recommends -o DPkg::Options::=--force-confold netcat libmariadbclient-dev libpq-dev build-essential git
# Upgrade pip
RUN pip install --upgrade pip
# Create unprivileged user
RUN useradd -u ${USER_ID} -ms /bin/bash -d /opt/alcali alcali
# Set default user
USER alcali
# Add env var and fix path
ENV PYTHONUNBUFFERED=1 PATH="/opt/alcali/.local/bin:${PATH}"
# Copy project
COPY --chown=alcali . /opt/alcali/code
# Set work directory
WORKDIR /opt/alcali/code
# Install dependencies
RUN pip install --user -U setuptools
# Install project
RUN pip install --user . mysqlclient psycopg2
EXPOSE 8000
ENTRYPOINT ["/opt/alcali/code/docker/utils/entrypoint.sh"]