-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
27 lines (21 loc) · 776 Bytes
/
Copy pathdockerfile
File metadata and controls
27 lines (21 loc) · 776 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
# Use an official PHP image with Apache
FROM php:8.2-apache
# Install system dependencies, PHP extensions, sudo, and sqlite3 client
RUN apt-get update && apt-get install -y \
libsqlite3-dev \
libcurl4-openssl-dev \
iputils-ping \
sudo \
sqlite3 \
&& docker-php-ext-install pdo_sqlite curl
# Grant the www-data user passwordless sudo access ONLY for the ping command.
RUN echo "www-data ALL=(ALL) NOPASSWD: /bin/ping" > /etc/sudoers.d/ping_access
# Copy the entrypoint script and make it executable
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Copy application files
COPY . /var/www/html/
# Set the entrypoint
ENTRYPOINT ["docker-entrypoint.sh"]
# Expose port 80 for the Apache web server
EXPOSE 80