-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
57 lines (43 loc) · 995 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
###
# Client
###
FROM node:18-alpine as node-builder
WORKDIR /ui
# install deps
COPY ui/package-lock.json ui/package.json ./
RUN npm install
# build
COPY ui .
RUN npm run build
###
# Server
###
FROM golang:1-alpine AS go-builder
# RUN apk add --no-cache gcc libffi-dev musl-dev libjpeg-turbo-dev
WORKDIR /go/src/app
# get deps
COPY go.mod go.sum ./
RUN go mod download
# build
COPY *.go ./
COPY defaults.yaml ./
COPY internal ./internal
COPY io ./io
COPY db ./db
COPY fonts ./fonts
COPY data/geo ./data/geo
# RUN go install -tags libjpeg .
COPY --from=node-builder /ui/dist/ ./ui/dist
RUN go install -tags embedui,embedgeo .
###
# Runtime
###
FROM alpine:latest
# RUN apk add --no-cache exiftool>12.06-r0 libjpeg-turbo
RUN apk add --no-cache exiftool ffmpeg
COPY --from=go-builder /go/bin/ /app
WORKDIR /app
RUN mkdir ./data && touch ./data/configuration.yaml
EXPOSE 8080
ENV PHOTOFIELD_DATA_DIR=./data
CMD ["./photofield"]