-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (33 loc) · 1019 Bytes
/
Dockerfile
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
# create image to export requirements
FROM python:3.11-slim AS poetry
# build dependencies
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
build-essential \
gcc \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
# install poetry
RUN python -m pip install --no-cache-dir --upgrade poetry==1.5.1
# copy dependencies
COPY poetry.lock pyproject.toml ./
# create a requirements file
RUN poetry export -f requirements.txt --without-hashes -o /tmp/requirements.txt
# create rnacentral image
FROM python:3.11-slim as rnacentral
ENV \
# python
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
# RNAcentral
RNACENTRAL_HOME="/srv/rnacentral/rnacentral-backend"
# create folder and set work directory
RUN mkdir -p $RNACENTRAL_HOME
WORKDIR $RNACENTRAL_HOME
# install requirements
COPY --from=poetry /tmp/requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt
# copy project
COPY . .
EXPOSE 8001