forked from dbarzin/mercator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (45 loc) · 1.38 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
FROM php:8.2-fpm-alpine3.16
# apparently you cannot pass both env variables
# and .env file
ENV DB_CONNECTION=sqlite
ENV DB_DATABASE=/var/www/mercator/db.sqlite
# system deps
RUN apk update && apk add curl nano bash ssmtp graphviz ca-certificates sqlite sqlite-dev postgresql12 postgresql12-dev nginx supervisor
# php deps
RUN apk add php8-zip \
php8-curl \
php8-mbstring \
php8-dom php8-ldap \
php8-soap \
php8-xdebug \
php8-mysqli \
php8-sqlite3 \
php8-pgsql \
php8-gd \
php8-xdebug \
php8-gd \
php8-pdo php8-pdo_sqlite php8-pdo_mysql php8-pdo_pgsql \
php8-fileinfo \
php8-simplexml php8-xml php8-xmlreader php8-xmlwriter \
php8-tokenizer \
composer
RUN docker-php-ext-install pgsql pdo_pgsql
# sources
COPY . /var/www/mercator
WORKDIR /var/www/mercator
# the sqlite file must exist
# RUN touch ${DB_DATABASE}
# add mercator:www user
RUN addgroup -S www && \
adduser -S mercator -G www && \
chown -R mercator:www /var/www /var/lib/nginx /var/log/nginx
# COPY nginx.conf /etc/nginx/http.d/mercator.conf
# RUN chown -R mercator:www
RUN cp docker/nginx.conf /etc/nginx/http.d/mercator.conf
RUN cp docker/supervisord.conf /etc/supervisord.conf
USER mercator:www
# install mercator deps
RUN composer install
EXPOSE 8000
CMD ["/usr/bin/supervisord"]
# APP_KEY="${APP_KEY:-base64:$(head -c 32 /dev/urandom|base64)}" php artisan serve --host=0.0.0.0 --port=8000