-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (36 loc) · 1.08 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
ARG PARENT=python:3.9.15
ARG NODE_PARENT=node:18.12.1
ARG PRODUCTION
ARG DEBUG
####
FROM ${NODE_PARENT} as frontend
ENV APP_DIR=/app
WORKDIR ${APP_DIR}
COPY frontend/package.json ${APP_DIR}
COPY frontend/package-lock.json ${APP_DIR}
RUN npm ci
COPY frontend ${APP_DIR}
RUN npm run build
####
FROM ${PARENT}
ENV MODULE_NAME=backend
ENV PORT=8000
ENV WORKERS=2
ENV APP_DIR=/usr/src/app/
RUN apt update
WORKDIR ${APP_DIR}
RUN mkdir -p ${APP_DIR}static/www
RUN git clone -b neurons https://github.com/SciCrunch/NIF-Ontology.git
COPY backend/requirements.txt ${APP_DIR}
RUN pip3 install --no-cache-dir --upgrade -r requirements.txt
COPY backend/requirements.txt backend/setup.py ${APP_DIR}
COPY backend/requirements.txt backend/version.py ${APP_DIR}
RUN python3 -m pip install -e .
RUN ontutils set ontology-local-repo ./NIF-Ontology/
COPY backend ${APP_DIR}
RUN python3 manage.py collectstatic --noinput
COPY --from=frontend /app/build/* ${APP_DIR}/static/
EXPOSE ${PORT}
COPY scripts/runserver.sh /usr/local/bin
RUN chmod 0755 /usr/local/bin/runserver.sh
ENTRYPOINT /usr/local/bin/runserver.sh