-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod
52 lines (42 loc) · 1.11 KB
/
Dockerfile.prod
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
# Pull base image
FROM python:3.11-slim-buster
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
python3-dev \
python3-pip \
python3-setuptools \
python3-wheel \
curl \
&& rm -rf /var/lib/apt/lists/*
# Get nodejs from source
RUN curl -sL https://deb.nodesource.com/setup_20.x -o /tmp/nodesource_setup.sh
# Install nodejs
RUN bash /tmp/nodesource_setup.sh
RUN apt-get install -y nodejs
# Set work directory (similiar to cd)
WORKDIR /cursus
# Copy project to docker container
COPY . .
# JavaScript dependencies related to the project
RUN npm install -g \
sass \
babel-cli \
@babel/preset-env \
uglify-js \
requirejs \
postcss \
postcss-cli \
autoprefixer
# Install dependencies
RUN pip install --upgrade pip
RUN pip install -e .
# Expose port
EXPOSE 80
# Remove webassets cache
RUN rm -rf /cursus/cursus/static/.webassets-cache
RUN rm -rf /cursus/cursus/static/css/min.bundle.css
RUN rm -rf /cursus/cursus/static/js/min.bundle.js
# Run the command as entry point
CMD ["python3", "manage.py", "waitress", "--port=80"]