create image for docker olympe api

This commit is contained in:
root 2017-10-03 01:31:25 +02:00
parent 2ef1809992
commit 967a153beb
4 changed files with 100 additions and 0 deletions

17
Olympe/api/Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM xataz/nginx-php
ENV UID=991 \
GID=991
RUN mkdir /sites-enabled \
&& apk add -U git \
&& git clone --recursive https://git.drycat.fr/Dryusdan/Olympe-phpAPI.git /api \
&& apk del git \
&& rm -rf /var/cache/apk/* /tmp/* /root/.gnupg /root/.cache/ /api/.git
COPY rootfs /
RUN chmod +x /usr/local/bin/startup
ENTRYPOINT ["/usr/local/bin/startup"]
CMD ["/bin/s6-svscan", "/etc/s6.d"]

35
Olympe/api/api.conf Normal file
View File

@ -0,0 +1,35 @@
server {
listen 8080;
server_name default;
index index.php index.html index.htm;
merge_slashes off;
large_client_header_buffers 4 32k;
root /shaarli/;
location / {
try_files $uri $uri/ @handler;
expires 30d;
root /shaarli/;
index index.html index.htm index.php;
}
location /[.*] {
try_files $uri $uri/ @handler;
expires 30d;
root /shaarli/;
index index.html index.htm index.php;
}
location @handler {
rewrite ^ /index.php?/$request_uri;
}
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_pass unix:/php/run/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /nginx/conf/fastcgi_params;
}
}

View File

@ -0,0 +1,32 @@
server {
listen 8080;
index index.php index.html index.htm;
merge_slashes off;
large_client_header_buffers 4 32k;
root /api/;
location / {
try_files $uri $uri/ @handler;
expires 30d;
root /shaarli/;
index index.html index.htm index.php;
}
location /[.*] {
try_files $uri $uri/ @handler;
expires 30d;
root /shaarli/;
index index.html index.htm index.php;
}
location @handler {
rewrite ^ /index.php?/$request_uri;
}
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_pass unix:/php/run/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /nginx/conf/fastcgi_params;
}
}

View File

@ -0,0 +1,16 @@
#!/bin/sh
addgroup -g ${GID} web && adduser -H -s /bin/sh -D -G web -u ${UID} web
mkdir -p /nginx /php
chown -R web:web /nginx /php /etc/s6.d /api
if [ '$@' == '' ]; then
echo "here"
exec su-exec web:web /bin/s6-svscan /etc/s6.d
else
echo "la"
exec su-exec web:web "$@"
fi