1+ FROM ubuntu:22.04
12
2- # first stage build the frontend
3- # FROM node:20-alpine3.18 as build
4- FROM --platform=linux/x86_64 alpine:3.21.2
3+ # Set non-interactive mode for apt-get
4+ ENV DEBIAN_FRONTEND=noninteractive
55
6- # Set the working directory in the container to /app
7- # Set the working directory in the container to /app
8- # WORKDIR /import
9- # COPY .. .
10- # Copy the current directory contents into the container at /app
11-
12- # COPY ../server_tsspredator .
13- # COPY ../requirements.txt .
14- # COPY ../setup.py .
15- # COPY ../TSSpredator.jar .
16-
17- # RUN corepack enable
18- # # Install Node.js dependencies
19- # RUN npm run build
20-
21-
22- # Set the working directory in the container to /app
6+ # Set the working directory
237WORKDIR /app
248
25- # copy the server directory and dist from previous buildstage into the container at /app
9+ # Update package lists and install required packages
10+ RUN apt-get update && apt-get install -y \
11+ wget \
12+ gcc \
13+ g++ \
14+ python3-dev \
15+ python3-venv \
16+ python3-pip \
17+ openjdk-17-jre-headless \
18+ libbz2-dev \
19+ libcurl4 \
20+ libkrb5-dev \
21+ zlib1g-dev \
22+ curl \
23+ && rm -rf /var/lib/apt/lists/*
24+
25+ # Copy application files
2626COPY server_tsspredator /app/server_tsspredator
2727COPY requirements.txt /app
2828COPY setup.py /app
2929COPY server_tsspredator/TSSpredator.jar /app
30- RUN apk add gcompat libbz2 libcurl libstdc++ krb5-dev zlib gcc musl-dev g++ curl-dev
31- RUN wget https://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/bedGraphToBigWig -P /app
32- RUN chmod +x /app/bedGraphToBigWig
33-
34- # Install java 17
35- RUN apk add --update --no-cache openjdk17-jre-headless
3630
31+ # Download bedGraphToBigWig and set execute permissions
32+ RUN wget https://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/bedGraphToBigWig -P /app && \
33+ chmod +x /app/bedGraphToBigWig
3734
38- # Install python3.11
39- RUN apk add --update --no-cache python3-dev py3-pip
35+ # Create a Python virtual environment and install dependencies
4036RUN python3 -m venv /app/env_tss_predator_celery
4137ENV PATH="/app/env_tss_predator_celery/bin:$PATH"
42- RUN python3 -m pip install --upgrade pip
43- # install python dependencies
44- RUN python3 -m pip install -r requirements.txt
38+ RUN python3 -m pip install --upgrade pip && \
39+ python3 -m pip install -r requirements.txt
4540
46- # Install the server package
41+ # Install the server package in editable mode
4742RUN pip install -e .
4843
49- # Make port 5001 available to the world outside this container
44+ # Clean up build files
45+ RUN rm -rf /app/requirements.txt /app/setup.py
46+
47+ # Expose the application port
5048EXPOSE 5001
49+
50+ # Set environment variables
5151ENV TSSPREDATOR_DATA_PATH="/data"
5252ENV TSSPREDATOR_SERVER_LOCATION="/app"
5353ENV TSSPREDATOR_TEMPDATA="/tmpData"
5454ENV TSSPREDATOR_REDIS_HOST="redis"
5555
56- RUN rm -rf /app/requirements.txt
57- RUN rm -rf /app/setup.py
58-
59-
60- # The command that will be executed when the container is run
61- CMD ["gunicorn","--workers", "6","--timeout","500","--graceful-timeout", "500", "--bind", "0.0.0.0:5001", "wsgi:tsspredator"]
56+ # Run the application via gunicorn
57+ CMD ["gunicorn", "--workers", "6", "--timeout", "500", "--graceful-timeout", "500", "--bind", "0.0.0.0:5001", "wsgi:tsspredator"]
0 commit comments