forked from shuup/shuup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (30 loc) · 1.2 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
33
34
35
36
37
38
FROM node:12.21.0-buster-slim as base
# This image is NOT made for production use.
LABEL maintainer="Eero Ruohola <[email protected]>"
RUN apt-get update \
&& apt-get --assume-yes install \
libpangocairo-1.0-0 \
python3 \
python3-dev \
python3-pil \
python3-pip \
&& rm -rf /var/lib/apt/lists/ /var/cache/apt/
# These invalidate the cache every single time but
# there really isn't any other obvious way to do this.
COPY . /app
WORKDIR /app
# The dev compose file sets this to 1 to support development and editing the source code.
# The default value of 0 just installs the demo for running.
ARG editable=0
RUN if [ "$editable" -eq 1 ]; then pip3 install -r requirements-tests.txt && python3 setup.py build_resources; else pip3 install shuup; fi
RUN python3 -m shuup_workbench migrate
RUN python3 -m shuup_workbench shuup_init
RUN echo '\
from django.contrib.auth import get_user_model\n\
from django.db import IntegrityError\n\
try:\n\
get_user_model().objects.create_superuser("admin", "[email protected]", "admin")\n\
except IntegrityError:\n\
pass\n'\
| python3 -m shuup_workbench shell
CMD ["python3", "-m", "shuup_workbench", "runserver", "0.0.0.0:8000"]