Docker/docker-compose enhancements

The following enhancements have been made to docker/docker-compose

* Fixed bug when building the image.
* docker-compose up starts the server
* Scaffolding inside the container respect the ownership of the files
outside it
* Volumes are tagged as 'delegated' in order to improve performance for
mac/windoze users.
* bundler stores packages in a volume. This whay new packages can be
added without rebuilding the image:

```bash
docker-compose run app bundle install
```
This commit is contained in:
Juan Salvador Pérez García
2018-06-01 15:51:06 +02:00
parent eea0c74707
commit 8161045009
4 changed files with 65 additions and 27 deletions

View File

@@ -1,8 +1,17 @@
# # Select ubuntu as the base image
FROM coreapps/ruby2.3
FROM ruby:2.3.6
# Install essential Linux packages
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev postgresql-client nodejs imagemagick
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev postgresql-client nodejs imagemagick sudo
# Files created inside the container repect the ownership
RUN adduser --shell /bin/bash --disabled-password --gecos "" consul \
&& adduser consul sudo \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN echo 'Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bundle/bin"' > /etc/sudoers.d/secure_path
RUN chmod 0440 /etc/sudoers.d/secure_path
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
# Define where our application will live inside the image
ENV RAILS_ROOT /var/www/consul