Skip to content

Commit

Permalink
Use debian stable for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Jul 27, 2022
1 parent cd04337 commit 19fe645
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ jobs:
sleep 15 # let the DB warm up a little
- name: Prepare Database
run: |
docker-compose run --rm web rake db:migrate
docker-compose run web bundle exec rake i18n:js:export
docker-compose run --rm web osmosis --rx docker/null-island.osm.xml --wd host=db database=openstreetmap user=openstreetmap password=openstreetmap validateSchemaVersion=no
docker-compose run --user=openstreetmap --rm web rake db:migrate
docker-compose run --user=openstreetmap web bundle exec rake i18n:js:export
docker-compose run --user=openstreetmap --rm web osmosis --rx docker/null-island.osm.xml --wd host=db database=openstreetmap user=openstreetmap password=openstreetmap validateSchemaVersion=no
- name: Test Basic Website
run: |
curl -siL http://127.0.0.1:3000 | egrep '^HTTP/1.1 200 OK'
curl -siL http://127.0.0.1:3000 | grep 'OpenStreetMap is the free wiki world map'
curl -siL http://127.0.0.1:3000/api/0.6/node/1 | grep 'Null Island'
- name: Test Complete Suite
run: |
docker-compose run --rm web bundle exec rails db:test:prepare
docker-compose run --rm web bundle exec rails test:all
docker-compose run --user=openstreetmap --rm web bundle exec rails db:test:prepare
docker-compose run --user=openstreetmap --rm web bundle exec rails test:all
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM debian:stable

ENV DEBIAN_FRONTEND=noninteractive

Expand All @@ -9,7 +9,7 @@ RUN apt-get update \
curl \
default-jre-headless \
file \
chromium-chromedriver \
chromium-driver \
libarchive-dev \
libffi-dev \
libgd-dev \
Expand All @@ -29,6 +29,11 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Configure the en_US locale
RUN sed -i -e "s/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/" /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale LANG=en_US.UTF-8

# Install compatible Osmosis to help users import sample data in a new instance
RUN curl -OL https://github.com/openstreetmap/osmosis/releases/download/0.47.2/osmosis-0.47.2.tgz \
&& tar -C /usr/local -xzf osmosis-0.47.2.tgz
Expand All @@ -47,4 +52,8 @@ RUN gem install bundler \
# Install NodeJS packages using yarnpkg
# `bundle exec rake yarn:install` will not work
ADD package.json yarn.lock /app/
RUN yarnpkg --ignore-engines install
RUN yarnpkg install

# Add a user
RUN useradd -d /app -M openstreetmap \
&& chown -R openstreetmap /app/tmp
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
- web-images:/home/osm/images
ports:
- "3000:3000"
user: openstreetmap
command: bundle exec rails s -p 3000 -b '0.0.0.0'
depends_on:
- db
Expand Down

0 comments on commit 19fe645

Please sign in to comment.