Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrefauth/88ec3133180ae98fdc5c83fd76f01ed8 to your computer and use it in GitHub Desktop.
Save andrefauth/88ec3133180ae98fdc5c83fd76f01ed8 to your computer and use it in GitHub Desktop.
FROM alpine:3.7
RUN echo 'http://dl-4.alpinelinux.org/alpine/edge/community/' >> /etc/apk/repositories
ENV PYTHON_VERSION=2.7.14-r2
ENV PY_PIP_VERSION=9.0.1-r1
ENV SUPERVISOR_VERSION=3.3.1
ENV NGINX_VERSION=1.12.2-r3
RUN mkdir /www && mkdir /www/myapp/
ADD src/ /www/myapp/
RUN \
apk add --update nginx=$NGINX_VERSION \
python=$PYTHON_VERSION \
py-pip=$PY_PIP_VERSION \
nano \
php7 \
php7-dev \
php7-curl \
php7-fpm \
php7-gd \
php7-intl \
php7-json \
php7-mbstring \
php7-mcrypt \
php7-memcached \
php7-mysqli \
php7-pdo \
php7-pdo_mysql \
php7-xdebug \
php7-xml \
php7-zip \
php7-xsl \
php7-redis \
php7-opcache \
php7-phar \
php7-xmlwriter \
php7-tokenizer \
php7-simplexml \
php7-ctype \
tzdata \
ca-certificates \
git autoconf \
file \
g++ \
gcc \
libc-dev \
make \
pkgconf \
re2c \
libtool \
check \
check-dev \
cyrus-sasl-dev \
libsodium-dev \
libssh2-dev \
imagemagick-dev \
yaml-dev \
curl && \
mkdir -p /tmp/nginx/client-body && \
pip install supervisor==$SUPERVISOR_VERSION && \
cp /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime && \
echo "America/Sao_Paulo" > /etc/timezone && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
update-ca-certificates && \
cd ~ && git clone --depth=1 -b 3.3.x git://github.com/phalcon/cphalcon.git && \
cd ~/cphalcon/build && \
./install && \
echo "extension=phalcon.so" > /etc/php7/conf.d/50-phalcon.ini && \
rm -rf ~/cphalcon && \
apk del git autoconf openssl-dev make m4 perl g++ gcc \
libc-dev check-dev cyrus-sasl-dev libsodium-dev \
musl-dev libssh2-dev yaml-dev imagemagick-dev zlib-dev tzdata php7-dev && \
rm -rf /var/cache/apk/*
ADD docker/php/hyper.sh/ /etc/php7/php-fpm.d/
ADD docker/php/php.ini /etc/php7/php.ini
ADD docker/nginx/default/nginx.conf /etc/nginx/nginx.conf
ADD docker/nginx/hyper.sh/myapp.conf /etc/nginx/conf.d/default.conf
ADD docker/supervisor/supervisor.conf /etc/supervisor.conf
RUN cd /www/myapp; composer install
CMD ["supervisord", "-c", "/etc/supervisor.conf"]
@killerwolf
Copy link

where are your configuration files supervisor.conf/nginx.conf ??

@default-work
Copy link

where are your configuration files supervisor.conf/nginx.conf ??

[supervisord]
nodaemon=true

[program:uwsgi]
command=/usr/local/bin/uwsgi --ini /etc/uwsgi/uwsgi.ini
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:nginx]
command=/usr/sbin/nginx
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

Graceful stop, see http://nginx.org/en/docs/control.html

stopsignal=QUIT

server {
listen 80;
client_max_body_size 1m;
location / {
try_files $uri @app;
proxy_pass http://127.0.0.1:80/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location @app {
include uwsgi_params;
uwsgi_pass unix:///tmp/uwsgi.sock;
}
location /static {
alias /app/static;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment