-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
56 lines (32 loc) · 1.12 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM debian:bullseye-slim AS debian-src
RUN --mount=type=cache,mode=0777,target=/var/cache/apt \
apt-get update && \
apt-get install -y curl git python3 python3-pip python3-venv sqlite3 vim virtualenvwrapper
RUN --mount=type=cache,mode=0777,target=/var/cache/apt \
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
apt-get install -y nodejs
ENV PIP_CACHE_DIR=/var/cache/pip
WORKDIR /opt/simple-radio
COPY api/requirements.txt api/requirements.txt
RUN --mount=type=cache,mode=0777,target=/var/cache/pip \
pip install -r api/requirements.txt
COPY api .
COPY package.json .
COPY package-lock.json .
RUN npm ci
COPY public ./public
COPY src ./src
COPY scripts ./scripts
COPY docker-entrypoint.sh .
EXPOSE 3000 8000
ENTRYPOINT ["./docker-entrypoint.sh"]
####
FROM debian-src as debian-compiled
RUN npm run build-stations
RUN npm run build
####
FROM nginx as nginx
ARG SERVER_NAME radio.codefork.com
COPY --from=debian-compiled /opt/simple-radio/build /usr/share/nginx/html
COPY nginx/default.conf /tmp/default.conf
RUN cat /tmp/default.conf | envsubst SERVER_NAME > /etc/nginx/conf.d/default.conf