FROM nginx RUN apt-get update -qq && apt-get -y install apache2-utils ENV RAILS_ROOT /usr/src/app WORKDIR $RAILS_ROOT RUN mkdir log COPY public public/ # Copy Nginx config template COPY docker/web/app.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