<commit_before>FROM maxvanderschee/base

LABEL maintainer "<EMAIL>"

# Env
ENV CONF non-ssl.conf
ENV APPURL localhost.nl www.localhost.nl

# Install core packages for nginx and php7.0.
RUN add-apt-repository ppa:certbot/certbot
RUN apt-get update -q
RUN apt-get install -y nginx php7.0 php7.0-fpm certbot
RUN apt-get clean -q && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Setup nginx config
WORKDIR /etc/nginx/
RUN rm nginx.conf
COPY nginx.conf nginx.conf
COPY non-ssl.conf sites-available/non-ssl.conf
COPY ssl.conf sites-available/ssl.conf

RUN rm /etc/nginx/sites-enabled/default
RUN ln -s /etc/nginx/sites-available/${CONF} /etc/nginx/sites-enabled/${CONF}

# Configure Nginx - enable gzip
RUN sed -i 's|# gzip_types|  gzip_types|' /etc/nginx/nginx.conf

# Setup security to nginx
RUN echo 'fastcgi_param  HTTP_PROXY         "";' >> /etc/nginx/fastcgi.conf
RUN rm /etc/php/7.0/fpm/pool.d/www.conf
COPY www.conf /etc/php/7.0/fpm/pool.d/www.conf

# Setup Php service
RUN mkdir -p /run/php/
RUN touch /run/php/php7.0-fpm.sock
RUN mkdir -p /etc/service/php-fpm
RUN touch /etc/service/php-fpm/run
RUN chmod +x /etc/service/php-fpm/run
RUN echo '#!/bin/bash \n\
    exec /usr/sbin/php-fpm7.0 -F' >> /etc/service/php-fpm/run
RUN echo "opcache.enable=1" >> /etc/php/7.0/fpm/php.ini
RUN echo "cgi.fix_pathinfo=1" >> /etc/php/7.0/fpm/php.ini

# Setup Nginx service
RUN mkdir -p /etc/service/nginx
RUN touch /etc/service/nginx/run
RUN chmod +x /etc/service/nginx/run
RUN echo '#!/bin/bash \n\
    exec /usr/sbin/nginx -g "daemon off;"' >>  /etc/service/nginx/run

# Configure nginx file for domain
WORKDIR /root
COPY bash.sh bash.sh
RUN bash /root/bash.sh

# Secure docker form application exploitation
RUN chown container:container /var/www/app -R

# Setup ssl deployment
RUN openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048

# Expose configuration and content volumes
VOLUME /etc/letsencrypt/archive /var/www/app
<commit_msg>app folder not yet created.. this should fix the error<commit_after>FROM maxvanderschee/base

LABEL maintainer "<EMAIL>"

# Env
ENV CONF non-ssl.conf
ENV APPURL localhost.nl www.localhost.nl

# Install core packages for nginx and php7.0.
RUN add-apt-repository ppa:certbot/certbot
RUN apt-get update -q
RUN apt-get install -y nginx php7.0 php7.0-fpm certbot
RUN apt-get clean -q && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Setup nginx config
WORKDIR /etc/nginx/
RUN rm nginx.conf
COPY nginx.conf nginx.conf
COPY non-ssl.conf sites-available/non-ssl.conf
COPY ssl.conf sites-available/ssl.conf

RUN rm /etc/nginx/sites-enabled/default
RUN ln -s /etc/nginx/sites-available/${CONF} /etc/nginx/sites-enabled/${CONF}

# Configure Nginx - enable gzip
RUN sed -i 's|# gzip_types|  gzip_types|' /etc/nginx/nginx.conf

# Setup security to nginx
RUN echo 'fastcgi_param  HTTP_PROXY         "";' >> /etc/nginx/fastcgi.conf
RUN rm /etc/php/7.0/fpm/pool.d/www.conf
COPY www.conf /etc/php/7.0/fpm/pool.d/www.conf

# Setup Php service
RUN mkdir -p /run/php/
RUN touch /run/php/php7.0-fpm.sock
RUN mkdir -p /etc/service/php-fpm
RUN touch /etc/service/php-fpm/run
RUN chmod +x /etc/service/php-fpm/run
RUN echo '#!/bin/bash \n\
    exec /usr/sbin/php-fpm7.0 -F' >> /etc/service/php-fpm/run
RUN echo "opcache.enable=1" >> /etc/php/7.0/fpm/php.ini
RUN echo "cgi.fix_pathinfo=1" >> /etc/php/7.0/fpm/php.ini

# Setup Nginx service
RUN mkdir -p /etc/service/nginx
RUN touch /etc/service/nginx/run
RUN chmod +x /etc/service/nginx/run
RUN echo '#!/bin/bash \n\
    exec /usr/sbin/nginx -g "daemon off;"' >>  /etc/service/nginx/run

# Configure nginx file for domain
WORKDIR /root
COPY bash.sh bash.sh
RUN bash /root/bash.sh

# Secure docker form application exploitation
RUN chown container:container /var/www -R

# Setup ssl deployment
RUN openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048

# Expose configuration and content volumes
VOLUME /etc/letsencrypt/archive /var/www/app

{'fraction_non_alphanumeric': 0.13625866050808313, 'fraction_numerical': 0.012317167051578136, 'mean_word_length': 3.3650615901455767, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 12, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1391596', 'n_tokens_mistral': 1593, 'n_tokens_neox': 1518, 'n_words': 401}