-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
49 lines (42 loc) · 1.29 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
#
# Use this dockerfile to run api-tools.
#
# Start the server using docker-compose:
#
# docker-compose build
# docker-compose up
#
# You can install dependencies via the container:
#
# docker-compose run api-tools composer install
#
# You can manipulate dev mode from the container:
#
# docker-compose run api-tools composer development-enable
# docker-compose run api-tools composer development-disable
# docker-compose run api-tools composer development-status
#
# OR use plain old docker
#
# docker build -f Dockerfile-dev -t api-tools .
# docker run -it -p "8080:80" -v $PWD:/var/www api-tools
#
FROM composer:2 AS get-composer
FROM php:8.2-apache
RUN apt-get update \
&& apt-get install -y git libzip-dev libicu-dev sqlite3\
&& docker-php-ext-install zip \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl \
&& a2enmod rewrite \
&& sed -i 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/000-default.conf \
&& mv /var/www/html /var/www/public \
&& echo "AllowEncodedSlashes On" >> /etc/apache2/apache2.conf
COPY --from=get-composer /usr/bin/composer /usr/local/bin/composer
WORKDIR /var/www
COPY .docker/entrypoint.sh /
RUN chmod +x /entrypoint.sh
RUN usermod -u 1000 www-data
USER www-data
ENTRYPOINT [ "/entrypoint.sh" ]
CMD [ "apache2-foreground" ]