-
Notifications
You must be signed in to change notification settings - Fork 57
/
dockerfile.dev
34 lines (26 loc) · 1.37 KB
/
dockerfile.dev
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
# Use the official python 3 base image
FROM python:3.10.13 as python-container
# Copy the requirements.txt file into the container
COPY requirements.txt .
# Install the python dependencies
RUN pip install -r requirements.txt
# Use JDK 11
ENV JAVA_HOME=/opt/java/openjdk
COPY --from=eclipse-temurin:11 $JAVA_HOME $JAVA_HOME
ENV PATH="${JAVA_HOME}/bin:${PATH}"
# Fetch the latest tagged licenses from Github for use in the Java license compares
RUN apt-get update \
&& apt-get -y install git
RUN mkdir /licenses && cd /licenses && git clone https://github.com/spdx/license-list-data.git --depth=1 && cd license-list-data && git fetch --tags && git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
RUN mkdir /licenses/current && cp /licenses/license-list-data/website/*.jsonld /licenses/current && cp /licenses/license-list-data/website/licenses.json /licenses/current && cp /licenses/license-list-data/website/exceptions.json /licenses/current
# Create the volume /spdxonlinetools which maps to the host
VOLUME [ "/spdxonlinetools" ]
# Move to spdxonlinetools folder
WORKDIR /spdxonlinetools
# Expose the port 8000 to publish
EXPOSE 8000
# Run migrations and start the development server on port 8000
CMD python src/manage.py migrate && \
python src/manage.py collectstatic --noinput && \
python src/populate.py && \
python src/manage.py runserver 0.0.0.0:8000