forked from dbarzin/mercator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
71 lines (56 loc) · 1.6 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
FROM php:8.3-fpm-alpine3.19
# system deps
RUN apk update && apk add git curl nano bash ssmtp graphviz fontconfig ttf-freefont ca-certificates sqlite sqlite-dev nginx gettext supervisor
# run font cache
RUN fc-cache -f
# php deps
RUN apk add php-zip \
php-curl \
php-mbstring \
php-dom \
php-ldap \
php-soap \
php-xdebug \
php-sqlite3 \
php-gd \
php-xdebug \
php-gd \
php-pdo php-pdo_sqlite \
php-fileinfo \
php-simplexml php-xml php-xmlreader php-xmlwriter \
php-tokenizer \
libzip-dev \
openldap-dev \
libpng \
libpng-dev
# Install PHP extensions
RUN docker-php-ext-install gd zip ldap pdo pdo_mysql
# Install composer
RUN curl -sS https://getcomposer.org/installer | php \
&& chmod +x composer.phar && mv composer.phar /usr/local/bin/composer
# Add mercator:www user
RUN addgroup --g 1000 -S www && \
adduser -u 1000 -S mercator -G www && \
chown -R mercator:www /var/www /var/lib/nginx /var/log/nginx /etc/nginx/http.d
# Clone sources from Github
WORKDIR /var/www/
RUN git clone https://github.com/dbarzin/mercator.git/
WORKDIR /var/www/mercator
# Copy config files
RUN cp docker/nginx.conf /etc/nginx/http.d/default.conf
RUN cp docker/supervisord.conf /etc/supervisord.conf
# change owner
RUN chown -R mercator:www /var/www/mercator
# Now work with Mercator user
USER mercator:www
# Run composer
RUN composer -n update
# Publish Laravel Vendor resources
RUN php artisan vendor:publish --all
# Create database folder
RUN mkdir sql
# copy environement varaibles file
RUN cp .env.sqlite .env
# Start surpervisord
EXPOSE 8000
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]