-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (42 loc) · 1.19 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
57
58
59
60
#################################
# PersonalMediaVault Dockerfile #
#################################
# Build backend
FROM golang:alpine as backend_builder
## Copy backend
ADD backend /root/backend
## Compile backend
WORKDIR /root/backend
RUN go build -o pmvd
# Build frontend
FROM node:alpine as frontend_builder
## Copy frontend
ADD frontend /root/frontend
## Build frontend
WORKDIR /root/frontend
RUN npm install
RUN npm run build
# Prepare runner
FROM alpine as runner
## Install common libraries
RUN apk add gcompat
## Install FFMPEG
RUN apk add --no-cache ffmpeg
ENV FFMPEG_PATH=/usr/bin/ffmpeg
ENV FFPROBE_PATH=/usr/bin/ffprobe
## Copy backend binary
COPY --from=backend_builder /root/backend/pmvd /usr/bin/pmvd
## Copy frontend
RUN mkdir -p /usr/lib/pmv/
COPY --from=frontend_builder /root/frontend/dist /usr/lib/pmv/frontend
ENV FRONTEND_PATH=/usr/lib/pmv/frontend
## Working directory
WORKDIR /root
## Default vault folder
RUN mkdir /vault
## Ports
EXPOSE 80
EXPOSE 443
## Entry point
ENTRYPOINT ["/usr/bin/pmvd"]
CMD ["--daemon", "--vault-path", "/vault"]