File size: 991 Bytes
1609a21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
Bootstrap: docker
From: python:3.8-slim-buster

%setup
    # Commands to set up the build environment, if necessary
    mkdir -p /app

%post
    # Set the working directory
    cd /app

    # Install system dependencies
    apt-get update && \
    apt-get install -y build-essential openslide-tools libgl1-mesa-glx && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

    # Copy the application code
    cp -r $SINGULARITY_BUILDDEF_DIR/* /app/

    # Install Python dependencies
    pip install -r /app/requirements.txt

    # Create a non-root user (similar to the Docker ARG approach)
    useradd -m -s /bin/bash -u ${USER_ID:-1000} myuser

%environment
    # Set environment variables, if needed
    export HOME=/home/myuser
    export PATH=/app:$PATH

%runscript
    # Script that is executed when the container is run
    exec /bin/bash

%labels
    Author Vatsal_Patel
    Version version2

%files
    # Files to copy from the current directory into the container
    ./ /app/