-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamd64.dockerfile
79 lines (65 loc) · 1.91 KB
/
amd64.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# :: Util
FROM alpine as util
RUN set -ex; \
apk add --no-cache \
git; \
git clone -b stable https://github.com/11notes/docker-util.git;
# :: Build
FROM golang:1.23.4-alpine3.21 as build
ENV BUILD_DIR=/go/ente/server
USER root
RUN set -ex; \
apk add --update --no-cache \
gcc \
musl-dev \
git \
build-base \
pkgconfig \
libsodium-dev; \
git clone https://github.com/ente-io/ente.git;
RUN set -ex; \
cd ${BUILD_DIR}; \
mkdir -p /opt/ente; \
go build -o /opt/ente/museum cmd/museum/main.go; \
mv ${BUILD_DIR}/configurations /opt/ente; \
mv ${BUILD_DIR}/migrations /opt/ente; \
mv ${BUILD_DIR}/mail-templates /opt/ente;
# :: Header
FROM 11notes/alpine:stable
COPY --from=util /docker-util/src /usr/local/bin
COPY --from=build /opt/ente/ /opt/ente
ENV APP_VERSION=4.2.3
ENV APP_NAME="ente"
ENV APP_ROOT=/ente
ENV POSTGRES_HOST="postgres"
ENV POSTGRES_PORT=5432
ENV POSTGRES_DATABASE="postgres"
ENV POSTGRES_USER="postgres"
ENV GIN_MODE=release
ENV ENTE_CONFIG_FILE="/ente/etc/config.yaml"
# :: Run
USER root
# :: prepare image
RUN set -ex; \
mkdir -p ${APP_ROOT}/etc;
# :: install application
RUN set -ex; \
apk add --update --no-cache \
libsodium-dev; \
rm /opt/ente/configurations/local.yaml; \
ln -s /ente/etc/config.yaml /opt/ente/configurations/local.yaml;
# :: copy root filesystem changes and add execution rights to init scripts
COPY ./rootfs /
RUN set -ex; \
chmod +x -R /usr/local/bin
# :: change home path for existing user and set correct permission
RUN set -ex; \
usermod -d ${APP_ROOT} docker; \
chown -R 1000:1000 \
${APP_ROOT};
# :: Volumes
VOLUME ["${APP_ROOT}/etc"]
# :: Monitor
HEALTHCHECK --interval=5s --timeout=2s CMD curl -kILs --fail http://localhost:8080/ || exit 1
# :: Start
USER docker