1
+ FROM ubuntu:22.04
1
2
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
5
5
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
23
7
WORKDIR /app
24
8
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
26
26
COPY server_tsspredator /app/server_tsspredator
27
27
COPY requirements.txt /app
28
28
COPY setup.py /app
29
29
COPY 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
36
30
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
37
34
38
- # Install python3.11
39
- RUN apk add --update --no-cache python3-dev py3-pip
35
+ # Create a Python virtual environment and install dependencies
40
36
RUN python3 -m venv /app/env_tss_predator_celery
41
37
ENV 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
45
40
46
- # Install the server package
41
+ # Install the server package in editable mode
47
42
RUN pip install -e .
48
43
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
50
48
EXPOSE 5001
49
+
50
+ # Set environment variables
51
51
ENV TSSPREDATOR_DATA_PATH="/data"
52
52
ENV TSSPREDATOR_SERVER_LOCATION="/app"
53
53
ENV TSSPREDATOR_TEMPDATA="/tmpData"
54
54
ENV TSSPREDATOR_REDIS_HOST="redis"
55
55
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