-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
55 lines (43 loc) · 1.09 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
49
50
51
52
53
54
55
# syntax=docker/dockerfile:1
# 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 50001
# Remove webassets cache
RUN rm -rf cursus/static/.webassets-cache
RUN rm -rf cursus/static/css/min.bundle.css
RUN rm -rf cursus/static/js/min.bundle.js
# Run the command as entry point
CMD ["cursus", "run"]