-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (29 loc) · 877 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
FROM python:3.9.21-alpine AS base_image
ENV PATH=/root/.local/bin:$PATH \
TRAFFCAP_REQUESTS_PREFIX="r" \
TRAFFCAP_DB_USER="" \
TRAFFCAP_DB_PASSWORD="" \
TRAFFCAP_DB_HOST="" \
TRAFFCAP_DB_NAME="/data/traffcap.db" \
TRAFFCAP_DB_DRIVER="sqlite" \
TRAFFCAP_SERVER_URL="localhost:9669" \
PYTHONPATH="src/traffcap" \
VITE_WS_API_URL="http://localhost:9669" \
VITE_API_URL="http://localhost:9669" \
BASE_URL="http://localhost:9669"
EXPOSE 9669
RUN apk --no-cache add curl nodejs npm && \
mkdir /traffcap && \
mkdir /data
COPY . /traffcap
WORKDIR /traffcap
# Install Python dependencies
RUN curl -sSL https://pdm.fming.dev/install-pdm.py | python3 - && \
pdm install --production
# Build frontend
RUN cd src/traffcap/spa && \
npm install && \
npm run build
WORKDIR /traffcap/src
VOLUME /data
CMD pdm run server