-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
49 lines (30 loc) · 1021 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
40
41
42
43
44
45
46
47
48
49
FROM python:3.9-slim
WORKDIR /app
RUN apt-get update && apt-get install -y \
build-essential \
libsqlite3-dev \
curl \
ca-certificates \
gnupg \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs
RUN node -v && npm -v
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY scheema_retail_frontend/static_src/package.json ./scheema_retail_frontend/static_src/
WORKDIR /app/scheema_retail_frontend/static_src
RUN npm install -g yarn && yarn install
WORKDIR /app
COPY . .
RUN python manage.py makemigrations
RUN python manage.py makemigrations scheema_retail_store
RUN python manage.py migrate
RUN python manage.py seed_products
RUN python manage.py tailwind build
RUN python manage.py collectstatic
EXPOSE 8000
ENV DJANGO_SETTINGS_MODULE=scheema_retail.settings
ENV PYTHONUNBUFFERED=1
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "scheema_retail.wsgi:application"]