-
Notifications
You must be signed in to change notification settings - Fork 55
/
Dockerfile-dev
70 lines (62 loc) · 2.09 KB
/
Dockerfile-dev
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM node:20-alpine3.16 AS node
FROM alpine:3.14
COPY --from=node /usr/lib /usr/lib
COPY --from=node /usr/local/lib /usr/local/lib
COPY --from=node /usr/local/include /usr/local/include
COPY --from=node /usr/local/bin /usr/local/bin
RUN apk add --no-cache \
python3-dev \
postgresql-dev \
coreutils \
alpine-sdk \
pcre \
pcre-dev \
libxslt-dev \
linux-headers \
libffi-dev \
bash \
bash-completion \
nginx \
openssl-dev \
geos-dev \
gdal \
gcc \
musl-dev \
cargo \
tzdata && \
ln -sf /usr/bin/python3 /usr/bin/python && \
python -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
ln -sf /usr/bin/pip3 /usr/bin/pip && \
pip install --upgrade pip setuptools && \
pip install supervisor==4.2.5 && \
mkdir -p /var/log/supervisord && \
rm -r /root/.cache && \
addgroup -g 1000 uwsgi && \
adduser -G uwsgi -H -u 1000 -S uwsgi && \
mkdir -p /run/nginx
### Install python requirements
WORKDIR /seed
COPY ./requirements.txt /seed/requirements.txt
COPY ./requirements/*.txt /seed/requirements/
RUN pip uninstall -y enum34
RUN pip install -r requirements/local.txt
# for remote debugging
RUN pip install remote-pdb
# for live reloading celery
RUN pip install watchdog[watchmedo]
### Install JavaScript requirements - do this first because they take awhile
### and the dependencies will probably change slower than python packages.
### README.md stops the no readme warning
COPY ./package.json /seed/package.json
COPY ./vendors/package.json /seed/vendors/package.json
COPY ./README.md /seed/README.md
# unsafe-perm allows the package.json postinstall script to run with the elevated permissions
RUN npm install --unsafe-perm
### Copy over the remaining part of the SEED application and some helpers
WORKDIR /seed
COPY . /seed/
COPY ./docker/wait-for-it.sh /usr/local/wait-for-it.sh
RUN git config --system --add safe.directory /seed
EXPOSE 80
CMD ["python", "manage.py", "runserver", "--settings=config.settings.docker_dev", "0.0.0.0:80"]