-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (39 loc) · 2.06 KB
/
Dockerfile
File metadata and controls
43 lines (39 loc) · 2.06 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
32
33
34
35
36
37
38
39
40
41
42
43
# If you make any changes to this file, don't forget to rebuild the Docker image using the --build flag:
# docker-compose up --build -d
FROM php:8.4-apache
# Install PHP XDebug, for step debugging.
# You can leave port 9007 for all your Docker containers. It doesn't conflict across containers like the localhost port does.
# Add this .vscode/launch.json file to your repo, then go to Run and Debug -> press play:
# {
# // Use IntelliSense to learn about possible attributes.
# // Hover to view descriptions of existing attributes.
# // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
# "version": "0.2.0",
# "configurations": [
# {
# "name": "Listen for Xdebug",
# "type": "php",
# "request": "launch",
# "port": 9007,
# "pathMappings": {
# "/var/www/html/": "${workspaceRoot}"
# }
# }
# ]
# }
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug
RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_port=9007" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.idekey=VSCODE" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# Install composer. Once the container is built and running, you can do `composer update` with the following shell command: `docker exec -it citation-bot-php-1 composer update`
RUN apt-get update && apt-get install -y git zip unzip \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer
# Allow directory listings. Not a security issue since this is a test environment. Makes it easier to navigate.
RUN a2enmod autoindex
RUN echo "<Directory /var/www/html>\n Options +Indexes\n AllowOverride All\n</Directory>" > /etc/apache2/conf-available/directory-listing.conf \
&& a2enconf directory-listing