-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
142 lines (115 loc) · 4.38 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Dockerfile for Known using MySQL/MariaDB
# initially forked from davesgonechina/docker-known
# inspired by ehdr/known and indiepaas/known
FROM ubuntu:jammy
LABEL description="Image for Known (withknown.com) using MySQL/MariaDB as backend" \
version="1.5" \
authors="Bjoern Stierand <bjoern-known@innovention.de>"
ENV branch 1.5
ENV known_url https://codeload.github.com/idno/known/tar.gz/${branch}
ENV DEBIAN_FRONTEND noninteractive
# Install Apache and extensions
# [Known PHP depepndencies](http://docs.withknown.com/en/latest/install/requirements.html),
# as of the 0.8.2 ("Giotto") release:
# - curl
# - date (included in libapache2-mod-php5)
# - dom (included in libapache2-mod-php5)
# - gd
# - json (included in libapache2-mod-php5)
# - libxml (included in libapache2-mod-php5)
# - mbstring (included in libapache2-mod-php5)
# - mysql
# - reflection (included in libapache2-mod-php5)
# - session (included in libapache2-mod-php5)
# - xmlrpc
RUN apt-get update && \
apt-get -yq --no-install-recommends install \
gnupg2 \
apache2 \
composer \
libapache2-mod-php8.1 \
php8.1-curl \
php8.1-gd \
php8.1-mysql \
php8.1-xmlrpc \
php8.1-mbstring \
php8.1-xml \
mysql-client \
unzip \
curl && \
rm -rf /var/lib/apt/lists/* && \
apt-get -yq clean
# Configure Apache
RUN cd /etc/apache2/mods-enabled \
&& ln -s ../mods-available/rewrite.load . \
&& ln -s ../mods-available/headers.load .
# Download and extract Known distribution
RUN mkdir -p /var/www/known \
&& cd /var/www/known \
&& curl -s ${known_url} | tar -xzf - \
&& mv known-${branch}/* /var/www/known \
&& mv known-${branch}/.htaccess /var/www/known \
&& rm -r known-${branch}
# Configure Apache
COPY apache2/sites-available/known.conf /etc/apache2/sites-available/
COPY files/composer.json /var/www/known
# Configure Known
WORKDIR /var/www/known
# This adds a unique file that changes when the branch changes for cache busting
ADD https://api.github.com/repos/idno/known/git/refs/heads/$BRANCH version.json
COPY config.ini .
RUN chmod 644 config.ini \
&& composer update --no-dev -o -a \
&& composer install --no-dev -o -a \
&& chown -R www-data:www-data /var/www/known/ \
&& cd /etc/apache2/sites-enabled \
&& chmod 644 ../sites-available/known.conf \
&& rm -f 000-default.conf \
&& ln -s ../sites-available/known.conf .
RUN composer require egoexpress/known-shortprofile \
egoexpress/known-smallheader \
egoexpress/known-pinboard \
idno/twitter \
idno/flickr
WORKDIR /var/www/known/IdnoPlugins
# Add Facebook plugin
RUN curl -s https://codeload.github.com/idno/Facebook/tar.gz/dev | tar xzf - \
&& mv Facebook-dev/ Facebook
# Add SoundCloud plugin
RUN curl -s https://codeload.github.com/idno/SoundCloud/tar.gz/dev | tar xzf - \
&& mv SoundCloud-dev/ SoundCloud
# Add WordPress plugin
RUN curl -s https://codeload.github.com/idno/WordPress/tar.gz/dev | tar xzf - \
&& mv WordPress-dev/ WordPress
# Add Diigo plugin
RUN curl -s https://codeload.github.com/timmmmyboy/Diigo/tar.gz/master | tar xzf - \
&& mv Diigo-master/ Diigo
# Add Foursquare plugin
RUN curl -s https://codeload.github.com/idno/Foursquare/tar.gz/dev | tar xzf - \
&& mv Foursquare-dev/ Foursquare
# Add Markdown plugin
RUN curl -s https://codeload.github.com/idno/Markdown/tar.gz/dev | tar xzf - \
&& mv Markdown-dev/ Markdown
# Add Pushover plugin
RUN curl -s https://codeload.github.com/timmmmyboy/Pushover/tar.gz/master | tar xzf - \
&& mv Pushover-master/ Pushover
# Add Reactions plugin
RUN curl -s https://codeload.github.com/kylewm/KnownReactions/tar.gz/master | tar xzf - \
&& mv KnownReactions-master/ Reactions
# Add Yourls plugin
RUN curl -s https://codeload.github.com/danito/KnownYourls/tar.gz/master | tar xzf - \
&& mv KnownYourls-master/ Yourls
# Add Journal plugin
RUN curl -s https://codeload.github.com/andrewgribben/KnownJournal/tar.gz/master | tar xzf - \
&& mv KnownJournal-master/ Journal
# Add Mastodon plugin
RUN curl -s https://codeload.github.com/danito/KnownMastodon/tar.gz/master | tar xzf - \
&& mv KnownMastodon-master/ Mastodon
# Set up container entrypoint
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod 700 /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
HEALTHCHECK CMD curl --fail http://localhost || exit 1
# Expose Apache port and run Apache
EXPOSE 80
CMD ["/usr/sbin/apache2", "-DFOREGROUND"]