Created
June 27, 2019 11:13
-
-
Save sourovroy/be4ea771bc641257086a630d2f88ec14 to your computer and use it in GitHub Desktop.
Ubuntu Dockerfile for PHP and Node
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
# Download base image ubuntu 18.04 | |
FROM ubuntu:18.04 | |
# DEBIAN_FRONTEND | |
ARG DEBIAN_FRONTEND=noninteractive | |
# replace shell with bash so we can source files | |
RUN rm /bin/sh && ln -s /bin/bash /bin/sh | |
# Update software repository and install cURL & Wget | |
RUN apt-get update && apt-get -y install curl wget zip vim | |
# Install PHP and it's dependencies | |
RUN apt-get install -y php7.2-cli php7.2-common php7.2-curl php7.2-json \ | |
php7.2-mbstring php7.2-intl php7.2-xml php7.2-zip | |
# Install Composer | |
RUN curl -sS https://getcomposer.org/installer | php -- \ | |
--install-dir=/usr/bin --filename=composer \ | |
&& chmod +x /usr/bin/composer | |
# nvm environment variables | |
ENV NVM_DIR /usr/local/nvm | |
ENV NODE_VERSION 10.16 | |
# Install node | |
RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | bash | |
RUN source $NVM_DIR/nvm.sh \ | |
&& nvm install $NODE_VERSION \ | |
&& nvm alias default $NODE_VERSION \ | |
&& nvm use default | |
# Copy project builder app to container OS | |
COPY project-builder /root/project-builder | |
# Run process command on startup | |
ENTRYPOINT ["/usr/bin/php", "/root/project-builder/app.php"] | |
EXPOSE 80 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment