comparison Dockerfile @ 16:790b6c0e71fb draft

planemo upload commit 34fc6bf8421ce1ff1f9dc7cfbb2317430569acdc
author galaxytrakr
date Fri, 15 May 2026 16:59:42 +0000
parents b15b07ad729b
children cfc91e1d2c9b
comparison
equal deleted inserted replaced
15:b15b07ad729b 16:790b6c0e71fb
25 FROM base AS builder 25 FROM base AS builder
26 26
27 # Update base packages and install build essentials 27 # Update base packages and install build essentials
28 RUN apt-get update && \ 28 RUN apt-get update && \
29 apt-get install -y --no-install-recommends \ 29 apt-get install -y --no-install-recommends \
30 wget \ 30 wget \
31 ca-certificates \ 31 ca-certificates \
32 bash \ 32 bash \
33 && apt-get clean && \ 33 && apt-get clean && \
34 rm -rf /var/lib/apt/lists/* 34 rm -rf /var/lib/apt/lists/*
35
36 # Copy the patch script
37 COPY patch_stringmlst.sh /tmp/patch_stringmlst.sh
38 RUN chmod +x /tmp/patch_stringmlst.sh
39 35
40 # Create conda environment with all dependencies 36 # Create conda environment with all dependencies
41 # Using mamba for faster dependency resolution 37 # Using mamba for faster dependency resolution
42 RUN mamba create -n seqsero2s -c conda-forge -c bioconda \ 38 RUN mamba create -n seqsero2s -c conda-forge -c bioconda \
43 python>=3 \ 39 python>=3 \
56 mlst>=2.32.2 \ 52 mlst>=2.32.2 \
57 perl-list-moreutils \ 53 perl-list-moreutils \
58 && mamba clean -afy 54 && mamba clean -afy
59 55
60 # Install SeqSero2S from local fork 56 # Install SeqSero2S from local fork
61 WORKDIR /tmp/build 57 WORKDIR /tmp/build/SeqSero2S
62 58
63 # Copy local SeqSero2S directory 59 # Copy the current build context (the cloned source code) into the container.
64 COPY SeqSero2S /tmp/build/SeqSero2S 60 COPY . .
65 61
66 # Install SeqSero2S 62 # Install SeqSero2S
67 RUN cd SeqSero2S && \ 63 RUN /opt/conda/envs/seqsero2s/bin/python -m pip install . -vv --no-deps --no-build-isolation --no-cache-dir
68 /opt/conda/envs/seqsero2s/bin/python -m pip install . -vv --no-deps --no-build-isolation --no-cache-dir
69 64
70 # Apply the stringMLST.py patch (from the conda recipe) 65 # Apply the stringMLST.py patch inline using 'sed'.
71 # The patch replaces dbPrefix reference with cwd to avoid path issues 66 # This exactly replicates the original python patch script by commenting out the old line and adding the new one.
72 RUN PREFIX=/opt/conda/envs/seqsero2s /tmp/patch_stringmlst.sh 67 RUN if [ -f "/opt/conda/envs/seqsero2s/bin/stringMLST.py" ]; then \
68 sed -i 's| log = dbPrefix+'\''.log'\''| # log = dbPrefix+'\''.log'\''\n log = os.path.join(os.getcwd(), "kmer.log")|g' /opt/conda/envs/seqsero2s/bin/stringMLST.py && \
69 echo "PATCHED: stringMLST.py log path fixed"; \
70 else \
71 echo "SKIP: stringMLST.py not found"; \
72 fi
73 73
74 # ============================================================================ 74 # ============================================================================
75 # Stage 3: Test image - runs validation tests 75 # Stage 3: Test image - runs validation tests
76 # ============================================================================ 76 # ============================================================================
77 FROM builder AS test 77 FROM builder AS test
108 CONDA_PREFIX=/opt/conda/envs/seqsero2s 108 CONDA_PREFIX=/opt/conda/envs/seqsero2s
109 109
110 # Install minimal runtime dependencies 110 # Install minimal runtime dependencies
111 RUN apt-get update && \ 111 RUN apt-get update && \
112 apt-get install -y --no-install-recommends \ 112 apt-get install -y --no-install-recommends \
113 ca-certificates \ 113 ca-certificates \
114 procps \ 114 procps \
115 && apt-get clean && \ 115 && apt-get clean && \
116 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 116 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
117 117
118 # Create working directory 118 # Create working directory
119 WORKDIR /data 119 WORKDIR /data
120 120
121 # Create non-root user for running the application 121 # Create non-root user for running the application
122 RUN useradd -m -u 1000 -s /bin/bash seqsero2s && \ 122 RUN useradd -m -u 1000 -s /bin/bash seqsero2s && \
123 chown -R seqsero2s:seqsero2s /data 123 chown -R seqsero2s:seqsero2s /data
124
125 USER seqsero2s 124 USER seqsero2s
126 125
127 # Add metadata labels 126 # Add metadata labels
128 LABEL org.opencontainers.image.version="1.1.4" \ 127 LABEL org.opencontainers.image.version="1.1.4" \
129 org.opencontainers.image.authors="LSTUGA" \ 128 org.opencontainers.image.authors="LSTUGA" \
133 org.opencontainers.image.licenses="GPL-2.0-or-later" \ 132 org.opencontainers.image.licenses="GPL-2.0-or-later" \
134 org.opencontainers.image.title="SeqSero2S" \ 133 org.opencontainers.image.title="SeqSero2S" \
135 org.opencontainers.image.description="Simplified Salmonella serotype prediction from genome sequencing data" 134 org.opencontainers.image.description="Simplified Salmonella serotype prediction from genome sequencing data"
136 135
137 # No entrypoint or command for dist target 136 # No entrypoint or command for dist target
137
138