-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
79 lines (56 loc) · 2.1 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM maven:3-eclipse-temurin-21 AS jar_builder
# Install git and clone the repository
RUN git clone https://github.com/cBioPortal/cbioportal-core.git /cbioportal-core
# Set the working directory in the Maven image
WORKDIR /app
# Copy the java source files and the pom.xml file into the image
RUN cp -R /cbioportal-core/src ./src
RUN cp /cbioportal-core/pom.xml .
# Build the application
RUN mvn clean package -DskipTests
FROM maven:3-eclipse-temurin-21
# Install git and clone the repository
RUN git clone https://github.com/cBioPortal/cbioportal-core.git /cbioportal-core
# Download system dependencies first to take advantage of docker caching
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
default-mysql-client \
default-libmysqlclient-dev \
python3 \
python3-setuptools \
python3-dev \
python3-venv \
unzip \
perl \
wget \
&& rm -rf /var/lib/apt/lists/*
# Create and activate a virtual environment
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
# Install any needed packages specified in requirements.txt
RUN /opt/venv/bin/pip install --no-cache-dir -r /cbioportal-core/requirements.txt
# Install dependencies from environment.txt
COPY requirements.txt .
RUN /opt/venv/bin/pip install --no-cache-dir -r requirements.txt
# Copy scripts and make them executable
RUN cp -R /cbioportal-core/scripts/ /scripts/
RUN chmod -R a+x /scripts/
# Copy the built JAR file from the first stage
COPY --from=jar_builder /app/core-*.jar /
# Set the working directory in the container
WORKDIR /scripts/
ENV PORTAL_HOME=/
# This file is empty. It has to be overridden by bind mounting the actual application.properties
RUN touch /application.properties
# Make image directory
RUN mkdir /uploaded_images
# Copy the rest of the application code to /app
COPY app/ /app/
# Add app to python path
ENV PYTHONPATH=/app:$PYTHONPATH
# Copy the entrypoint script to /app
COPY entrypoint.sh /entrypoint.sh
# Ensure the entrypoint script is executable
RUN chmod +x /entrypoint.sh
EXPOSE 3001
ENTRYPOINT ["/entrypoint.sh"]