Skip to content

Commit

Permalink
More small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wvengen committed Oct 26, 2019
1 parent bcec4ef commit d3fc488
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ RUN export DATABASE_URL=mysql2://localhost/temp && \
export SECRET_KEY_BASE=thisisnotimportantnow && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y mysql-server && \
apt-get install -y mariadb-server && \
/etc/init.d/mysql start && \
cp config/app_config.yml.SAMPLE config/app_config.yml && \
bundle exec rake db:setup assets:precompile && \
rm -Rf config/app_config.yml tmp/* && \
/etc/init.d/mysql stop && \
rm -Rf /run/mysqld /tmp/* /var/tmp/* /var/lib/mysql /var/log/mysql* && \
apt-get purge -y --auto-remove mysql-server && \
apt-get purge -y --auto-remove mariadb-server && \
rm -Rf /var/lib/apt/lists/* /var/cache/apt/*

# Make relevant dirs writable for app user
Expand Down
7 changes: 7 additions & 0 deletions Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ RUN deps='libmagic-dev chromium' && \
apt-get install --no-install-recommends -y $deps && \
rm -Rf /var/lib/apt/lists/* /var/cache/apt/*

# Need to run chromium without sandbox to work at all in Docker, make it the default
RUN mv /usr/bin/chromium /usr/bin/chromium.real && \
echo "#!/bin/sh\n/usr/bin/chromium.real --no-sandbox $@" >/usr/bin/chromium && \
chmod a+x /usr/bin/chromium

ENV PORT=3000 \
SMTP_SERVER_PORT=2525 \
RAILS_ENV=development \
RAILS_LOG_TO_STDOUT=true \
RAILS_SERVE_STATIC_FILES=true \
\
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true \
\
BUNDLE_PATH=/home/app/bundle \
BUNDLE_APP_CONFIG=/home/app/bundle/config

Expand Down
2 changes: 2 additions & 0 deletions doc/SETUP_DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ If instead you just want to run Foodsoft without changing its code, please refer
9. Have phun!

For running integration tests, you also need the Chromium/Chrome web browser.
On Debian that would be `sudo apt-get install chromium chromium-sandbox`, on Ubuntu
`sudo apt-get install chromium-browser`.

### Manual configuration

Expand Down
2 changes: 1 addition & 1 deletion doc/SETUP_DEVELOPMENT_DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Open a rails console

Setup the test database

docker-compose-dev run --rm foodsoft bundle exec rake db:setup RAILS_ENV=test DATABASE_URL=mysql2://root:secret@mariadb/test
docker-compose-dev run --rm foodsoft bundle exec rake db:setup RAILS_ENV=test DATABASE_URL=mysql2://root:secret@mariadb/test?encoding=utf8

Run the tests

Expand Down
1 change: 1 addition & 0 deletions spec/integration/balancing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
find('#order_article_article_id').select(new_article.name)
sleep 0.1
find('input[type="submit"]').click
sleep 0.1
end
expect(page).to_not have_selector('form#new_order_article')
expect(page).to have_content(new_article.name)
Expand Down

0 comments on commit d3fc488

Please sign in to comment.