-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (38 loc) · 1.42 KB
/
Dockerfile
File metadata and controls
58 lines (38 loc) · 1.42 KB
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
56
57
58
# Python DEPS
FROM python:3.10-slim AS python-base
COPY requirements.txt .
RUN apt-get update -y \
&& apt-get install -y build-essential \
&& pip install -r requirements.txt \
&& pip install uwsgi
# NODE DEPS
FROM node:24 AS node-deps
WORKDIR /home/node/app
COPY package.json package-lock.json bower.json gulpfile.js /home/node/app/
COPY compair/static/ /home/node/app/compair/static/
RUN mkdir -p compair/templates/static/ \
&& npm install --production --no-optional \
&& node_modules/gulp/bin/gulp.js \
&& node_modules/gulp/bin/gulp.js prod
# Python Application image
FROM python:3.10-slim AS python-app
LABEL maintainer="Pan Luo <pan.luo@ubc.ca>"
ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH /code
ENV DEV 0
WORKDIR /code
COPY --from=python-base /root/.cache /root/.cache
COPY --from=python-base /requirements.txt /code/requirements.txt
RUN pip install -r requirements.txt \
&& pip install uwsgi
# Copy the base uWSGI ini file to enable default dynamic uwsgi process number
COPY deploy/docker/uwsgi.ini /etc/uwsgi/
COPY deploy/docker/docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
COPY . /code/
# overrite static files from node built deps
COPY --from=node-deps /home/node/app/compair/static/ /code/compair/static/
COPY --from=node-deps /home/node/app/compair/templates/static/ /code/compair/templates/static/
VOLUME ["/code/persistent"]
EXPOSE 3031
CMD ["uwsgi", "--ini", "/etc/uwsgi/uwsgi.ini"]