VatsalPatel18 commited on
Commit
1609a21
·
1 Parent(s): 49f4666

Singularity Container

Browse files
.ipynb_checkpoints/Singularity-checkpoint ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Bootstrap: docker
2
+ From: python:3.8-slim-buster
3
+
4
+ %setup
5
+ # Commands to set up the build environment, if necessary
6
+ mkdir -p /app
7
+
8
+ %post
9
+ # Set the working directory
10
+ cd /app
11
+
12
+ # Install system dependencies
13
+ apt-get update && \
14
+ apt-get install -y build-essential openslide-tools libgl1-mesa-glx && \
15
+ apt-get clean && \
16
+ rm -rf /var/lib/apt/lists/*
17
+
18
+ # Copy the application code
19
+ cp -r $SINGULARITY_BUILDDEF_DIR/* /app/
20
+
21
+ # Install Python dependencies
22
+ pip install -r /app/requirements.txt
23
+
24
+ # Create a non-root user (similar to the Docker ARG approach)
25
+ useradd -m -s /bin/bash -u ${USER_ID:-1000} myuser
26
+
27
+ %environment
28
+ # Set environment variables, if needed
29
+ export HOME=/home/myuser
30
+ export PATH=/app:$PATH
31
+
32
+ %runscript
33
+ # Script that is executed when the container is run
34
+ exec /bin/bash
35
+
36
+ %labels
37
+ Author Vatsal_Patel
38
+ Version version2
39
+
40
+ %files
41
+ # Files to copy from the current directory into the container
42
+ ./ /app/
Singularity ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Bootstrap: docker
2
+ From: python:3.8-slim-buster
3
+
4
+ %setup
5
+ # Commands to set up the build environment, if necessary
6
+ mkdir -p /app
7
+
8
+ %post
9
+ # Set the working directory
10
+ cd /app
11
+
12
+ # Install system dependencies
13
+ apt-get update && \
14
+ apt-get install -y build-essential openslide-tools libgl1-mesa-glx && \
15
+ apt-get clean && \
16
+ rm -rf /var/lib/apt/lists/*
17
+
18
+ # Copy the application code
19
+ cp -r $SINGULARITY_BUILDDEF_DIR/* /app/
20
+
21
+ # Install Python dependencies
22
+ pip install -r /app/requirements.txt
23
+
24
+ # Create a non-root user (similar to the Docker ARG approach)
25
+ useradd -m -s /bin/bash -u ${USER_ID:-1000} myuser
26
+
27
+ %environment
28
+ # Set environment variables, if needed
29
+ export HOME=/home/myuser
30
+ export PATH=/app:$PATH
31
+
32
+ %runscript
33
+ # Script that is executed when the container is run
34
+ exec /bin/bash
35
+
36
+ %labels
37
+ Author Vatsal_Patel
38
+ Version version2
39
+
40
+ %files
41
+ # Files to copy from the current directory into the container
42
+ ./ /app/