-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev.Dockerfile
57 lines (48 loc) · 1.58 KB
/
dev.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
45
46
47
48
49
50
51
52
53
54
55
56
57
ARG PYTHON_VERSION=3.12
ARG DEBIAN_VERSION=slim-bookworm
FROM python:${PYTHON_VERSION}-${DEBIAN_VERSION}
# LABELS
LABEL Maintainer="Bento Project"
LABEL org.opencontainers.image.description="Local development image for the Transcriptomics Data Service."
LABEL devcontainer.metadata='[{ \
"customizations": { \
"vscode": { \
"extensions": ["ms-python.python", "eamodio.gitlens", "ms-python.black-formatter"], \
"settings": {"workspaceFolder": "/tds"} \
} \
}, \
"remoteUser": "tds" \
}]'
RUN apt-get update -y; \
apt-get upgrade -y; \
apt-get install -y \
bash \
build-essential \
curl \
git \
gosu \
jq \
libpq-dev \
perl \
procps \
vim; \
rm -rf /var/lib/apt/lists/*;
RUN pip install --no-cache-dir -U pip; \
pip install --no-cache-dir poetry==1.8.5; \
pip install --no-cache-dir 'uvicorn[standard]>=0.34.0,<0.35'
# INIT DIRECTORIES
RUN mkdir /tds /run/secrets
WORKDIR /tds
COPY pyproject.toml .
COPY poetry.lock .
COPY gosu_entrypoint.bash .
COPY run.dev.bash .
# Install production + development dependencies
# Without --no-root, we get errors related to the code not being copied in yet.
# But we don't want the code here, otherwise Docker cache doesn't work well.
RUN poetry config virtualenvs.create false && \
poetry --no-cache install --no-root
RUN chmod +x ./*.bash
# Don't copy in actual code, since it'll be mounted in via volume for development
ENTRYPOINT [ "bash", "./gosu_entrypoint.bash" ]
CMD [ "bash", "./run.dev.bash" ]