forked from bystrogenomics/bystro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.python
57 lines (41 loc) · 1.42 KB
/
Dockerfile.python
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# ---- Build Golang Binaries ----
FROM golang:1.21.4 AS go-builder
# Set the environment variable for Go binaries. This makes sure the binaries are saved to a defined path.
ENV GOBIN=/app/bin
# Install the specific versions of the Go programs
RUN go install github.com/bystrogenomics/[email protected];
# Use Ubuntu as the base image to match the GitHub Actions environment
FROM python:3.11.8-bookworm
# Copy the compiled Go binaries from the builder stage
COPY --from=go-builder /app/bin/ /app/bin/
# Add app/bin to PATH
ENV PATH="/app/bin:${PATH}"
# # Install common dependencies and utilities
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
wget curl\
openssl libcurl4-openssl-dev libssl-dev \
tar lz4 pigz tabix unzip \
patch \
awscli \
unzip \
libssl-dev \
pkg-config \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& . $HOME/.cargo/env
# Make sure Cargo is in the PATH
ENV PATH="/root/.cargo/bin:${PATH}"
ENV PATH="/usr/local/go/bin:${PATH}"
# Set up the workspace
WORKDIR /workspace
COPY ./python ./python
COPY ./config ./config
# Install Python and dependencies
RUN pip install --upgrade pip && pip install python/ -r python/requirements-dev.txt
COPY ./Makefile ./
RUN make install-python
# Run pytest before installation
RUN pytest python/ --maxfail=1 --disable-warnings
ENTRYPOINT ["bystro-api"]
CMD ["--help"]