-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (23 loc) · 968 Bytes
/
Dockerfile
File metadata and controls
32 lines (23 loc) · 968 Bytes
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 dunglas/frankenphp:latest
RUN apt-get update && apt-get install -y \
curl \
gettext \
libpq-dev \
netcat-traditional \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install pdo pdo_mysql pdo_pgsql mysqli
# Disable display_errors to avoid HTML output in JSON responses
RUN echo "display_errors = Off" > /usr/local/etc/php/php.ini && \
echo "log_errors = On" >> /usr/local/etc/php/php.ini && \
echo "error_reporting = E_ALL & ~E_DEPRECATED" >> /usr/local/etc/php/php.ini
WORKDIR /app
# Download api.php as index.php
RUN curl -sS -o /app/index.php https://raw.githubusercontent.com/mevdschee/php-crud-api/main/api.php
# Copy Caddy configuration template and entrypoint script
COPY Caddyfile.template /app/Caddyfile.template
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# FrankenPHP uses Caddyfile for configuration (generated by entrypoint.sh)
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]