Skip to content

Instantly share code, notes, and snippets.

@hasMobi
Created March 13, 2016 10:56
Show Gist options
  • Save hasMobi/e198555704ee57e84399 to your computer and use it in GitHub Desktop.
Save hasMobi/e198555704ee57e84399 to your computer and use it in GitHub Desktop.
FROM richarvey/nginx-php-fpm
EXPOSE 80
WORKDIR /usr/share/nginx/html/
# Copy the project source code from the host machine
# to a temporary folder in the Docker
COPY ./code /usr/share/nginx/tmp_code/
# Clean up the server's HTML folder first
RUN rm -frv /usr/share/nginx/html/*
# Check if it was cleaned up
RUN ls /usr/share/nginx/html/
# Copy source code to the HTML folder
RUN cp -r -v /usr/share/nginx/tmp_code/* /usr/share/nginx/html/
# Check if source code was copied
RUN ls /usr/share/nginx/html/
# Remove the temporary source code,
# since we now copied it to the HTML folder
RUN rm -frv /usr/share/nginx/tmp_code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment