1234567891011121314151617181920212223242526 |
- # build from the official Nginx image
- FROM nginx
- # install essential Linux packages
- RUN apt-get update -qq && apt-get -y install apache2-utils
- # establish where Nginx should look for files
- ENV RAILS_ROOT /app
- WORKDIR /app
- # create log directory
- RUN mkdir -p log
- # copy over static assets
- COPY public public/
- # copy our Nginx config template
- COPY config/containers/nginx.conf /tmp/docker_example.nginx
- # substitute variable references in the Nginx config template for real values from the environment
- # put the final config in its place
- RUN envsubst '$RAILS_ROOT' < /tmp/docker_example.nginx > /etc/nginx/conf.d/default.conf
- # Use the "exec" form of CMD so Nginx shuts down gracefully on SIGTERM (i.e. `docker stop`)
- CMD [ "nginx", "-g", "daemon off;" ]
- EXPOSE 80
|