-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile for easy local testing
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
FROM debian:buster-slim | ||
|
||
# Usage: | ||
# (1) Build image (only required once or after this file was changed): | ||
# $ docker build -t photoboothbase . | ||
# (2) Start the container: | ||
# $ docker run --rm -v "$(pwd):/var/www/html/" -p 8080:80 photoboothbase | ||
# (3) Go to: http://localhost:8080 | ||
|
||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get dist-upgrade -y \ | ||
&& apt-get install -y nginx php-fpm php-gd gphoto2 unclutter | ||
|
||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y curl vim gnupg git | ||
|
||
RUN set -x \ | ||
&& sed -i 's/^\(\s*\)index index\.html\(.*\)/\1index index\.php index\.html\2/g' /etc/nginx/sites-available/default \ | ||
&& sed -i '/location ~ \\.php$ {/s/^\(\s*\)#/\1/g' /etc/nginx/sites-available/default \ | ||
&& sed -i '/include snippets\/fastcgi-php.conf/s/^\(\s*\)#/\1/g' /etc/nginx/sites-available/default \ | ||
&& sed -i '/fastcgi_pass unix:\/run\/php\//s/^\(\s*\)#/\1/g' /etc/nginx/sites-available/default \ | ||
&& sed -i '/.*fastcgi_pass unix:\/run\/php\//,// { /}/s/^\(\s*\)#/\1/g; }' /etc/nginx/sites-available/default \ | ||
&& /usr/sbin/nginx -t -c /etc/nginx/nginx.conf | ||
|
||
RUN set -x \ | ||
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ | ||
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ | ||
&& apt update && apt install -y yarn | ||
|
||
RUN set -x \ | ||
&& mkdir /run/php \ | ||
&& echo '#!/bin/bash -xe' > /start.sh \ | ||
&& echo 'cd /var/www/html && yarn install && yarn build' >> /start.sh \ | ||
&& echo '/usr/sbin/php-fpm7.3 -D' >> /start.sh \ | ||
&& echo 'exec /usr/sbin/nginx -g "daemon off;"' >> /start.sh \ | ||
&& chmod +x /start.sh | ||
|
||
EXPOSE 80 | ||
|
||
STOPSIGNAL SIGTERM | ||
|
||
ENTRYPOINT [ "/start.sh" ] |