-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (23 loc) · 1.13 KB
/
Copy pathDockerfile
File metadata and controls
31 lines (23 loc) · 1.13 KB
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
FROM php:8.5-apache
# Build and install latest SQLite from source
RUN apt-get update && apt-get install -y gcc make && rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://www.sqlite.org/2026/sqlite-autoconf-3510300.tar.gz -o /tmp/sqlite.tar.gz \
&& tar -xzf /tmp/sqlite.tar.gz -C /tmp \
&& cd /tmp/sqlite-autoconf-3510300 \
&& CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA=1" ./configure --prefix=/usr/local \
&& make -j$(nproc) \
&& make install \
&& ldconfig \
&& rm -rf /tmp/sqlite*
# Build pdo_sqlite against the newly installed SQLite
RUN docker-php-ext-configure pdo_sqlite --with-pdo-sqlite=/usr/local \
&& docker-php-ext-install pdo pdo_sqlite
# Enable .htaccess overrides + mod_rewrite (pretty /post/<slug> permalinks)
RUN sed -i 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf \
&& a2enmod rewrite
# Raise PHP upload limits
RUN echo "upload_max_filesize=20M\npost_max_size=22M" > /usr/local/etc/php/conf.d/uploads.ini
COPY www/ /var/www/html/
# Create the DB directory owned by www-data so SQLite can write at runtime
RUN mkdir -p /var/db && chown www-data:www-data /var/db
EXPOSE 80