-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (34 loc) · 1.35 KB
/
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
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9-alpine3.14
RUN apk --no-cache add git
ARG ADB_GITHASH
ARG ADB_GITBRANCH
WORKDIR /app
# anonymous pull
RUN git config --global url."https://".insteadOf git:// \
&& git config --global url."https://github.com/".insteadOf git@github.com: \
&& cat ~/.gitconfig
# git clone as root lib folder, since it contains submodules
RUN git clone --recurse-submodules --depth=1 -b $ADB_GITBRANCH https://github.com/ArtifactDB/artifactdb-docker.git lib \
&& cd lib \
&& git checkout $ADB_GITHASH
RUN \
# install build & run dependencies
apk --no-cache add sudo gcc musl-dev linux-headers bash py3-virtualenv git curl build-base postgresql-dev \
&& apk --no-cache add libmagic \
&& python -m pip install --upgrade pip 'ipython>=8.12.0' awscli==1.18.76 \
# adb-*, develop mode to keep checked out code as the active version
&& cd /app/lib/artifactdb-identifiers \
&& pip install -e . \
&& cd /app/lib/artifactdb-utils \
&& pip install -e . \
&& cd /app/lib/artifactdb-backend \
&& pip install -e . \
# uninstall build deps and cache
&& rm -rf /root/.cache/pip \
&& apk del sudo gcc musl-dev linux-headers build-base postgresql-dev \
# adjust run deps again
&& apk --no-cache add postgresql-libs libmagic
WORKDIR /app
ENV MODULE_NAME rest.main
ENV PORT 8000
EXPOSE 8000