-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.aarch64
107 lines (89 loc) · 3.4 KB
/
Dockerfile.aarch64
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# syntax=docker/dockerfile:1
# #
# @project keeweb
# @usage keeweb docker image
# @file Dockerfile
# @repo https://github.com/keeweb/keeweb
# https://github.com/keeweb/docker-alpine-base
# https://hub.docker.com/repository/docker/keeweb/keeweb
# https://hub.docker.com/repository/docker/aetherinox/alpine-base
# #
FROM ghcr.io/keeweb/alpine-base:3.20-arm64
# #
# Set Args
# #
ARG BUILD_DATE
ARG VERSION
ARG NGINX_VERSION
# #
# Set Labels
# #
LABEL maintainer="Aetherinox"
LABEL org.opencontainers.image.authors="Aetherinox"
LABEL org.opencontainers.image.vendor="Keeweb"
LABEL org.opencontainers.image.title="Keeweb Password Manager"
LABEL org.opencontainers.image.description="Keeweb password manager"
LABEL org.opencontainers.image.source="https://github.com/keeweb/keeweb"
LABEL org.opencontainers.image.documentation="https://github.com/keeweb/keeweb"
LABEL org.opencontainers.image.url="https://github.com/keeweb/keeweb/pkgs/container/keeweb"
LABEL org.opencontainers.image.licenses="MIT"
LABEL build_version="Keeweb v${VERSION} build-date: ${BUILD_DATE}"
# #
# Set Env Var
# #
ENV TZ="Etc/UTC"
ENV URL_REPO_BASE="https://github.com/keeweb/docker-alpine-base/pkgs/container/alpine-base"
ENV URL_REPO_APP="https://github.com/keeweb/keeweb/pkgs/container/keeweb"
ENV FILE_NAME="index.html"
ENV PORT_HTTP=80
ENV PORT_HTTPS=443
# #
# Install
# #
RUN \
if [ -z ${NGINX_VERSION+x} ]; then \
NGINX_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:nginx$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
fi && \
apk add --no-cache \
wget \
logrotate \
openssl \
apache2-utils \
nginx==${NGINX_VERSION} \
nginx-mod-http-fancyindex==${NGINX_VERSION} && \
echo "**** Install Build Packages ****" && \
echo "**** Configure Nginx ****" && \
echo 'fastcgi_param HTTP_PROXY ""; # https://httpoxy.org/' >> \
/etc/nginx/fastcgi_params && \
echo 'fastcgi_param PATH_INFO $fastcgi_path_info; # http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_split_path_info' >> \
/etc/nginx/fastcgi_params && \
echo 'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/#connecting-nginx-to-php-fpm' >> \
/etc/nginx/fastcgi_params && \
echo 'fastcgi_param SERVER_NAME $host; # Send HTTP_HOST as SERVER_NAME. If HTTP_HOST is blank, send the value of server_name from nginx (default is `_`)' >> \
/etc/nginx/fastcgi_params && \
rm -f /etc/nginx/http.d/default.conf && \
rm -f /etc/nginx/conf.d/stream.conf && \
rm -f /config/www/index.html && \
echo "**** Setup Logrotate ****" && \
sed -i "s#/var/log/messages {}.*# #g" \
/etc/logrotate.conf && \
sed -i 's#/usr/sbin/logrotate /etc/logrotate.conf#/usr/sbin/logrotate /etc/logrotate.conf -s /config/log/logrotate.status#g' \
/etc/periodic/daily/logrotate
# #
# Set work directory
# #
WORKDIR /config/www
# #
# Add local files
# #
COPY root/ /
# #
# Ports and volumes
# #
EXPOSE ${PORT_HTTP} ${PORT_HTTPS}
# #
# In case user sets up the cron for a longer duration, do a first run
# and then keep the container running. Hacky, but whatever.
# #
# CMD ["sh", "-c", "/run.sh ; /task.sh ; tail -f /dev/null"]