Last active
August 29, 2015 14:09
-
-
Save carlgrundberg/a0b3a27a4019922c4e47 to your computer and use it in GitHub Desktop.
Dockerfile for LEMP setup, Ubuntu + Nginx + Mysql + PHP
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
FROM ubuntu:14.04 | |
MAINTAINER Menmo <teknik@menmo.se> | |
# Keep upstart from complaining | |
RUN dpkg-divert --local --rename --add /sbin/initctl | |
RUN ln -sf /bin/true /sbin/initctl | |
# Let the container know that there is no tty | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update | |
RUN apt-get -y upgrade | |
RUN apt-get -y install curl | |
# nginx from nginx.org to get newer version than available in | |
RUN echo "deb http://nginx.org/packages/ubuntu/ lucid nginx" >> /etc/apt/sources.list | |
RUN echo "deb-src http://nginx.org/packages/ubuntu/ lucid nginx" >> /etc/apt/sources.list | |
RUN curl -O http://nginx.org/keys/nginx_signing.key | |
RUN apt-key add nginx_signing.key | |
# Basic Requirements | |
RUN apt-get -y install mysql-server mysql-client nginx php5-fpm php5-mysql php5-cli php-apc git pwgen python-setuptools vim locate | |
# mysql config | |
RUN sed -i -e"s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf | |
# Setup SSH-access | |
RUN apt-get install -y openssh-server | |
RUN mkdir /var/run/sshd | |
RUN echo 'root:password' | chpasswd | |
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config | |
# SSH login fix. Otherwise user is kicked off after login | |
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd | |
ENV NOTVISIBLE "in users profile" | |
RUN echo "export VISIBLE=now" >> /etc/profile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment