diff --git a/Dockerfile b/Dockerfile index 4cc0712..d7539cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,19 +15,18 @@ WORKDIR /app ENV RAILS_ENV development ENV RACK_ENV development ENV NODE_ENV production +ENV GIT_HASH 2dad2bb572aa458760decde5320c382b3080a22e + +RUN git clone https://github.com/snibox/snibox.git /app && cd /app && git reset --hard $GIT_HASH -RUN git clone https://github.com/snibox/snibox.git /app COPY Gemfile ./ RUN gem install bundler && bundle install COPY database.yml ./config/ COPY application.rb ./config/ -COPY docker-entrypoint.sh ./ VOLUME /app/db/database -RUN ./bin/rake db:migrate - -RUN ./bin/rake assets:precompile +RUN bin/rake assets:precompile EXPOSE 3000 diff --git a/README.md b/README.md index e050d2b..39559db 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,14 @@ To run this container use following parameters: docker run -d --name snibox \ --volume /path/to/local/db:/app/db/database \ --publish 80:3000 \ + --restart always \ snibox ``` After first run you probably will see error due to database hasn't been initialized in the attached volume. Pleas run following command to create empty database: ```bash -docker exec -ti rack db:migrate +docker exec /app/bin/rails db:migrate ``` -This will create new database instance and Snibox is ready to go. +This will create new database instance and Snibox is ready to go. \ No newline at end of file