Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Crispy1975/bc1a3a5ae07075eb04cf603215a1f952 to your computer and use it in GitHub Desktop.
Save Crispy1975/bc1a3a5ae07075eb04cf603215a1f952 to your computer and use it in GitHub Desktop.
Dockerfile
FROM ubuntu:trusty
MAINTAINER Crispy1975 "https://example.com"
# Kill old apt cache
RUN rm -R /var/lib/apt/lists/* -vf
# Update and install
RUN apt-get update \
&& apt-get install -y htop vim supervisor mcrypt bash-completion cron bash rsyslog nginx \
&& apt-get install -y git-core curl openssh-client \
&& apt-get -y upgrade \
&& apt-get -y install -f
# Copy repo access keys over
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
# correcting bashrc for bash-completion
RUN printf "\n\nif [ -f /etc/bash_completion ] && ! shopt -oq posix; then\n\t. /etc/bash_completion\nfi" >> /root/.bashrc
RUN ( mkdir -p /var/log/supervisor ; mkdir -p /log/ ; mkdir -p /data/http ; exit 0 )
RUN chown www-data:www-data /data/http
# Adding default supervisor file to container
ADD files/supervisor.conf /etc/supervisor/conf.d/
# Adding rsyslogs for cronjob
ADD files/cron-rsyslog.conf /etc/rsyslog.d/60-cron.conf
# Clean out the apt cache
RUN apt-get clean
# Copy site files
ADD . /var/www
# Copy nginx config
ADD files/nginx.conf /etc/nginx/sites-enabled/default
EXPOSE 80
# For running supervisor container at starting of docker container
CMD ( /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment