-
Notifications
You must be signed in to change notification settings - Fork 28
Docker
Ryan Wold edited this page Mar 17, 2021
·
11 revisions
WORK IN PROGRESS
⚠️
Touchpoints can be run in a docker containers, which provides a way for developers to get up and running easily, by handling dependencies in a consistent way.
- Create an oauth app on Github and capture github_client_id & github_secret ( https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/ )
- Create S3 bucket on AWS and capture
AWS_ACCESS_KEY
,AWS_SECRET
,S3_BUCKET_NAME
&AWS_REGION
- HOWTO
- clone touchpoints with
git clone [email protected]:GSA/touchpoints.git
cd touchpoints
cp .env.sample .env
- edit .env and enter values for
GITHUB_CLIENT_ID
,GITHUB_SECRET
,S3_AWS_ACCESS_KEY_ID
,S3_AWS_SECRET_ACCESS_KEY
,S3_BUCKET_NAME
&AWS_REGION
captured above - edit config/database.yml and uncomment host and user variables for development and test
- build docker images:
docker-compose up --build
- run db:create:
docker-compose exec website rails db:create
- run db:setup:
docker-compose exec website rails db:setup
- start -
docker-compose up
- stop -
docker-compose down
- The web app can be accessed at http://localhost:3000
- The postgresql port is exposed and can be accessed at localhost:5432
The first time you log into the web app using your GitHub credentials you will get an error stating your user has not been setup with an organization.
I did the following to resolve this issue:
- open a rails console window:
docker-compose exec website rails c
- get my db user object: ">> u = User.where(email: my_email_address).first
- update my organization_id and set my admin flag to super user
-
- u.organization_id =2
-
- u.admin = true
-
- u.save
For reference, default data is loaded via the db/seeds.rb
file.
- Enter bash shell within any container:
docker-compose exec website/postgres/redis bash
- list running containers
docker-compose ps
- documentation: ( https://docs.docker.com/compose/reference/overview/ )