Ticket #31900: Dockerfile

File Dockerfile, 1.4 KB (added by Julien Chol, 4 years ago)

Dockerfile for test build

Line 
1FROM python:3.7-slim-buster
2
3ENV PYTHONUNBUFFERED 1
4
5RUN mkdir /code
6
7RUN addgroup --system --gid 1001 non-root && adduser --system non-root --gid 1001 --uid 1001 && chown -R non-root:non-root /code
8
9RUN apt-get update \
10 && apt-get install -y gcc \
11 && pip install --no-cache-dir Django pywatchman\
12 && apt-get purge -y gcc \
13 && apt-get autoremove -y \
14 && apt-get clean
15
16# Install watchman
17RUN apt-get install -y wget unzip \
18 && wget https://github.com/facebook/watchman/releases/download/v2020.08.17.00/watchman-v2020.08.17.00-linux.zip \
19 && unzip watchman-*-linux.zip \
20 && mkdir -p /usr/local/{bin,lib} /usr/local/var/run/watchman \
21 && cp watchman-*-linux/bin/* /usr/local/bin \
22 && cp watchman-*-linux/lib/* /usr/local/lib \
23 && chmod 755 /usr/local/bin/watchman \
24 && chmod 2777 /usr/local/var/run/watchman \
25 && rm -rf watchman-*-linux watchman-*-linux.zip \
26 && apt-get purge -y wget unzip \
27 && apt-get autoremove -y \
28 && apt-get clean
29
30USER non-root
31
32WORKDIR /code
33
34RUN django-admin startproject debug_watchman
35
36WORKDIR /code/debug_watchman
37
38RUN echo "import os" >> debug_watchman/settings.py
39RUN echo "LOGGING = {'version': 1, 'disable_existing_loggers': False, 'handlers': {'console': {'class': 'logging.StreamHandler'}}, 'loggers': {'django': {'handlers': ['console'], 'level': 'DEBUG'}}} if os.environ.get('LOG', None) else {}" >> debug_watchman/settings.py
40
41CMD ["python", "manage.py","runserver", "0.0.0.0:8000"]
Back to Top