File tree Expand file tree Collapse file tree 6 files changed +58
-5
lines changed Expand file tree Collapse file tree 6 files changed +58
-5
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ FROM ruby:2.5
22
33RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
44RUN apt-get update -qq && apt-get install -y build-essential \
5- libpq-dev nodejs qt5-default libqt5webkit5-dev \
6- gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x
5+ libpq-dev nodejs qt5-default libqt5webkit5-dev \
6+ gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x
77
88RUN mkdir /WebsiteOne
99WORKDIR /WebsiteOne
@@ -14,7 +14,7 @@ RUN bundle install
1414
1515COPY package.json /WebsiteOne/package.json
1616COPY package-lock.json /WebsiteOne/package-lock.json
17- RUN npm install bower && npm install
17+ RUN npm install
1818
1919COPY . /WebsiteOne
2020
Original file line number Diff line number Diff line change @@ -3,13 +3,17 @@ services:
33 db :
44 image : postgres
55 volumes :
6- - ./tmp/db :/var/lib/postgresql/data:rw
6+ - dbVolume :/var/lib/postgresql/data
77 web :
88 build : .
99 command : bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
1010 volumes :
11- - . :/WebsiteOne
11+ - webVolume :/WebsiteOne
1212 ports :
1313 - " 3000:3000"
1414 depends_on :
1515 - db
16+
17+ volumes :
18+ dbVolume :
19+ webVolume:
Original file line number Diff line number Diff line change 1+ # How to use docker to spin up WebSiteOne
2+
3+ ## Setup docker
4+
5+ Execute this setup just for the first time, or when you want to recreate everything from scratch.
6+
7+ ** BE AWARE IT WILL DELETE ALL YOUR DATA, including the Postgres Database.**
8+
9+ ```
10+ $ ./docker/setup.sh
11+ ```
12+
13+ ## Start docker
14+
15+ Start the application
16+
17+ ```
18+ $ ./docker/start.sh
19+ ```
20+
21+ ## Stop docker
22+
23+ Stop the application
24+
25+ ```
26+ $ ./docker/stop.sh
27+ ```
28+
29+ ps: those docker commands were tested under the following environment:
30+
31+ - MacOS 10.13.6
32+ - Docker version 18.06.0-ce, build 0ffa825
33+ - docker-compose version 1.22.0, build f46880f
34+
35+ If it doesn't work for you, try to check your docker version and consider upgrading it if you have an older version.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ docker-compose down --rmi all --volumes --remove-orphans
4+ docker-compose build --force-rm --no-cache
5+ docker-compose run --rm web rake db:create
6+ docker-compose run --rm web rake db:migrate RAILS_ENV=development
7+ docker-compose run --rm web rake db:seed
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ docker-compose down
4+ docker-compose up
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ docker-compose down
You can’t perform that action at this time.
0 commit comments