-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
48 lines (34 loc) · 1.53 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
39
40
41
42
43
44
45
46
47
48
# Use the official Python base image
FROM python:3.10.4
# Set the working directory in the container
WORKDIR /black
# Set the locale
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
# Install system locales
RUN apt-get update && apt-get install -y locales locales-all
# Generate and set the desired locale
RUN locale-gen fa_IR.UTF-8
ENV LANG fa_IR.UTF-8
ENV LC_ALL fa_IR.UTF-8
# Copy project
COPY . .
# Create a virtual environment
RUN python -m venv data
# Activate the virtual environment
SHELL ["/bin/bash", "-c"]
RUN source data/bin/activate
RUN pip3 install --upgrade pip
# Install project dependencies
RUN pip3 install -r requirements.txt
RUN pip3 install wagtail-color-panel django-user-visit django-user-agents geoip2 django-summernote
# Run migrations
RUN python3 manage.py makemigrations --empty blog && python3 manage.py makemigrations --empty product && python3 manage.py makemigrations --empty category && python3 manage.py makemigrations --empty brand && python3 manage.py makemigrations --empty cart && python3 manage.py makemigrations user_accounts && python3 manage.py makemigrations index && python3 manage.py makemigrations product && python3 manage.py makemigrations blog && python3 manage.py makemigrations category && python3 manage.py makemigrations brand && python3 manage.py makemigrations cart
RUN python3 manage.py migrate
# Run tests
Run python3 manage.py collectstatic
#RUN python manage.py test
# Expose the Django development server port
EXPOSE 8000
# Start the Django development server
CMD python manage.py runserver 0.0.0.0:8000