-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from workflowhub-eu/refactor-workflow
Refactored Snakemake workflow and generate example output
- Loading branch information
Showing
15 changed files
with
473,580 additions
and
1,276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,44 @@ | ||
FROM python:3.11-slim | ||
# Stage 1: Build environment | ||
FROM python:3.11-slim AS build-stage | ||
|
||
RUN pip install poetry | ||
# Install build tools and Poetry | ||
RUN apt-get update && apt-get install -y build-essential \ | ||
&& pip install poetry | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Install build tools for Snakemake (gcc, make, etc.) | ||
RUN apt-get update && apt-get install -y build-essential | ||
# Copy dependency files and install dependencies | ||
COPY pyproject.toml poetry.lock /app/ | ||
RUN poetry config virtualenvs.create false \ | ||
&& poetry install --no-interaction --no-ansi | ||
|
||
# Copy the pyproject.toml file | ||
COPY pyproject.toml /app/ | ||
# Copy and install the application | ||
COPY . /app | ||
RUN poetry install | ||
|
||
# Install the dependencies | ||
RUN poetry install --no-root | ||
# Stage 2: Snakemake runtime environment | ||
FROM snakemake/snakemake:latest | ||
|
||
# Copy the rest of the application files | ||
COPY . /app | ||
# Install Poetry | ||
RUN pip install poetry | ||
|
||
# Install the package | ||
RUN poetry install | ||
WORKDIR /app | ||
|
||
# Copy the application from the build stage | ||
COPY --from=build-stage /app /app | ||
|
||
# Install dependencies | ||
RUN pip install -r <(poetry export --format requirements.txt --without-hashes) \ | ||
&& pip install -e . | ||
|
||
# Set up non-root user | ||
RUN groupadd -r snakemake && useradd -r -g snakemake snakemake \ | ||
&& chown -R snakemake:snakemake /app | ||
|
||
# Install Snakemake using Poetry | ||
RUN poetry add snakemake | ||
USER snakemake | ||
|
||
# Set the entry point for the container | ||
ENTRYPOINT ["poetry", "run"] | ||
# Configure Python path | ||
ENV PYTHONPATH="/app:${PYTHONPATH}" | ||
|
||
CMD ["help"] | ||
# Set the entry point | ||
ENTRYPOINT ["snakemake"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.