-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathDockerfile-dev
More file actions
90 lines (79 loc) · 2.77 KB
/
Dockerfile-dev
File metadata and controls
90 lines (79 loc) · 2.77 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
FROM node:22-alpine3.19
RUN apk add --no-cache \
postgresql-dev \
coreutils \
alpine-sdk \
pcre \
pcre-dev \
libxslt-dev \
linux-headers \
libffi-dev \
bash \
bash-completion \
nginx \
brotli \
nginx-mod-http-brotli \
openssl-dev \
geos-dev \
gdal \
gdal-dev \
gcc \
musl-dev \
cargo \
tzdata \
bzip2-dev \
readline-dev \
sqlite-dev \
ncurses-dev \
xz-dev \
zlib-dev \
libxml2-dev && \
mkdir -p /var/log/supervisord && \
mkdir -p /run/nginx
## Note on some of the commands above:
## - coreutils is required due to an issue with our wait-for-it.sch script:
## https://github.com/vishnubob/wait-for-it/issues/71
# Install pyenv and Python globally
ENV PYTHON_VERSION=3.9.22
ENV PYENV_ROOT="/opt/pyenv"
ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"
RUN git clone https://github.com/pyenv/pyenv.git $PYENV_ROOT && \
$PYENV_ROOT/bin/pyenv install $PYTHON_VERSION && \
$PYENV_ROOT/bin/pyenv global $PYTHON_VERSION && \
ln -sf $PYENV_ROOT/shims/python /usr/local/bin/python && \
ln -sf $PYENV_ROOT/shims/python3 /usr/local/bin/python3 && \
ln -sf $PYENV_ROOT/shims/pip /usr/local/bin/pip && \
ln -sf $PYENV_ROOT/shims/pip3 /usr/local/bin/pip3
# Make sure non-root users inherit pyenv paths
ENV PYENV_ROOT="/opt/pyenv"
ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"
# Install pip
RUN bash -c "python3 -m ensurepip --upgrade && python3 -m pip install --upgrade pip setuptools && \
pip install supervisor==4.3.0"
### 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.
COPY ./package.json /seed/package.json
COPY ./pnpm-lock.yaml /seed/pnpm-lock.yaml
COPY ./pnpm-workspace.yaml /seed/pnpm-workspace.yaml
COPY ./vendors/package.json /seed/vendors/package.json
COPY ./ng_seed/seed-angular /seed/ng_seed/seed-angular
### Build SEED Angular then cleanup
RUN npm install -g pnpm && \
pnpm install && \
pnpm -C /seed/ng_seed/seed-angular build
### Copy over the remaining part of the SEED application and some helpers
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"]