-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (33 loc) · 1.15 KB
/
Dockerfile
File metadata and controls
41 lines (33 loc) · 1.15 KB
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
# syntax=docker/dockerfile:experimental
# Build stage: Install python dependencies
# ===
FROM ubuntu:noble AS python-dependencies
RUN apt-get update && apt-get install --no-install-recommends --yes \
python3-pip python3-setuptools python3-wheel python3-venv \
build-essential git # remove git after review
ADD requirements.txt /tmp/requirements.txt
RUN pip3 config set global.disable-pip-version-check true
RUN python3 -m venv /venv
ENV PATH="/venv/bin:${PATH}"
RUN --mount=type=cache,target=/root/.cache/pip pip3 install --requirement /tmp/requirements.txt
# Build the production image
# ===
FROM ubuntu:noble
# Install python and import python dependencies
RUN apt-get update && apt-get install --no-install-recommends --yes \
python3-setuptools python3-lib2to3 python3-pkg-resources \
ca-certificates libsodium-dev gpg
COPY --from=python-dependencies /venv /venv
ENV PATH="/venv/bin:${PATH}"
# Set up environment
ENV LANG C.UTF-8
WORKDIR /srv
# Import code, build assets and mirror list
ADD . .
RUN rm -rf package.json
# Set revision ID
ARG BUILD_ID
ENV TALISKER_REVISION_ID "${BUILD_ID}"
# Setup commands to run server
ENTRYPOINT ["./entrypoint"]
CMD ["0.0.0.0:80"]