-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
39 lines (28 loc) · 1.14 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 python:3.10
WORKDIR /app
RUN python -m venv /app/venv
COPY requirements*.in /app/
RUN /app/venv/bin/pip install -U pip pip-tools && \
/app/venv/bin/pip-compile requirements.in && \
/app/venv/bin/pip install -r requirements.txt
FROM python:3.10-slim
RUN apt-get -qq update \
&& apt-get -qq install -y \
bzip2 \
curl \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
WORKDIR app
ADD . /app
RUN mkdir /app/venv
ENV PATH=/app/venv/bin:$PATH
COPY --from=0 /app/venv /app/venv
COPY --from=opbeans/opbeans-frontend:latest /app/build /app/opbeans/static/build
## To get the client name/version from package.json
COPY --from=opbeans/opbeans-frontend:latest /app/package.json /app/opbeans/static/package.json
RUN sed 's/<head>/<head>{% block head %}{% endblock %}/' /app/opbeans/static/build/index.html | sed 's/<script type="text\/javascript" src="\/rum-config.js"><\/script>//' > /app/templates/base.html
# init demo database
RUN mkdir -p /app/demo \
&& DATABASE_URL="sqlite:////app/demo/db.sql" ELASTIC_APM_DISABLE_SEND=true ELASTIC_APM_CENTRAL_CONFIG=false flask db upgrade
EXPOSE 3000
CMD ["honcho", "start", "--no-prefix"]