This repository has been archived by the owner on Dec 12, 2019. It is now read-only.
forked from alphagov/govuk-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic support for support and support-api
- Loading branch information
Ben Thorner
committed
Jun 5, 2019
1 parent
85bc8c9
commit 1cd31a5
Showing
9 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM ruby:2.6.3 | ||
RUN apt-get update -qq && apt-get upgrade -y && apt-get install -y build-essential libpq-dev libxml2-dev libxslt1-dev | ||
RUN apt-get install -y postgresql-client | ||
RUN apt-get clean | ||
|
||
RUN useradd -m build | ||
USER build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
GOVUK_DOCKER_RUN=govuk-docker run support-api-default | ||
|
||
default: | ||
${GOVUK_DOCKER_RUN} bundle | ||
${GOVUK_DOCKER_RUN} sh -c 'rake db:migrate 2>/dev/null || rake db:setup' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
default: &default | ||
adapter: postgresql | ||
encoding: unicode | ||
# For details on connection pooling, see rails configuration guide | ||
# http://guides.rubyonrails.org/configuring.html#database-pooling | ||
pool: 5 | ||
# Necessary to allow creating a db with different encodings. | ||
# See http://www.postgresql.org/docs/9.1/static/manage-ag-templatedbs.html for details | ||
template: template0 | ||
|
||
development: | ||
<<: *default | ||
url: <%= ENV["DATABASE_URL"] %> | ||
|
||
test: | ||
<<: *default | ||
url: <%= ENV["TEST_DATABASE_URL"] %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: '3.7' | ||
|
||
x-support-api: &support-api | ||
build: | ||
context: . | ||
dockerfile: support-api/Dockerfile | ||
image: support-api | ||
volumes: | ||
- ..:/govuk:delegated | ||
- bundle:/usr/local/bundle | ||
- home:/home/build | ||
- ./support-api/database.yml:/govuk/support-api/config/database.yml | ||
working_dir: /govuk/support-api | ||
|
||
services: | ||
support-api-default: | ||
<<: *support-api | ||
depends_on: | ||
- postgres | ||
- redis | ||
environment: | ||
DATABASE_URL: "postgresql://postgres@postgres/support-api" | ||
TEST_DATABASE_URL: "postgresql://postgres@postgres/support-api-test" | ||
REDIS_URL: redis://redis | ||
|
||
support-api-backend: &support-api-backend | ||
<<: *support-api | ||
depends_on: | ||
- postgres | ||
- redis | ||
- nginx-proxy | ||
environment: | ||
DATABASE_URL: "postgresql://postgres@postgres/support-api" | ||
REDIS_URL: redis://redis | ||
VIRTUAL_HOST: support-api.dev.gov.uk | ||
ports: | ||
- "3000" | ||
command: rails s -b 0.0.0.0 -P /tmp/rails.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM ruby:2.6.3 | ||
|
||
RUN apt-get update -qq && apt-get upgrade -y && apt-get install -y build-essential | ||
RUN apt-get install -y libxss1 libappindicator1 libindicator7 | ||
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && apt install -y ./google-chrome*.deb | ||
|
||
RUN wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 | ||
RUN tar -xf phantomjs-2.1.1-linux-x86_64.tar.bz2 | ||
RUN cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs | ||
|
||
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - | ||
RUN apt-get update -qq && apt-get install -y nodejs | ||
|
||
RUN apt-get clean | ||
|
||
RUN useradd -m build | ||
USER build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
GOVUK_DOCKER_RUN=govuk-docker run support-default | ||
|
||
default: | ||
${GOVUK_DOCKER_RUN} bundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
version: '3.7' | ||
|
||
x-support: &support | ||
build: | ||
context: . | ||
dockerfile: support/Dockerfile | ||
image: support | ||
volumes: | ||
- ..:/govuk:delegated | ||
- bundle:/usr/local/bundle | ||
- home:/home/build | ||
working_dir: /govuk/support | ||
|
||
services: | ||
support-default: | ||
<<: *support | ||
depends_on: | ||
- redis | ||
environment: | ||
REDIS_URL: redis://redis | ||
|
||
support-backend: &support-backend | ||
<<: *support | ||
depends_on: | ||
- redis | ||
- nginx-proxy | ||
- support-api-backend | ||
environment: | ||
VIRTUAL_HOST: support.dev.gov.uk | ||
REDIS_URL: redis://redis | ||
ports: | ||
- "3000" | ||
command: rails s -b 0.0.0.0 -P /tmp/rails.pid |