-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
64 lines (43 loc) · 2.21 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Web interface for Captain's Log. This is a Rails app that handles all CRUD
operations and calls out to external services for entry processing and
querying.
=== Requirements
- Ruby 2.6.1
- PostgreSQL 10.3
=== Development
bundle # install dependencies
bundle exec rake db:setup # setup database
bundle exec rake test # run tests
bundle exec rake lint # run linters
bundle exec rake test:system # run e2e tests
bundle exec rake lint:all # run all linters
bundle exec rails s # start the web server process
bundle exec rake jobs:work # start the worker process
=== Database
Captain's Log uses a single database, one that which this application need read
and write access to. The database and schema create by `rake db:setup` is the
one that external services use and require access to as well. These services
should only need read-only access.
=== Configuration
The application needs to know what database it should read and write from and
where the external services live:
DATABASE_URL # example postgres://[email protected]:5432/captainslog
JAEGER_HOST # example localhost
JAEGER_PORT # example 6831
PROCESSOR_ADDRESS # example http://host.docker.internal:8081
QUERIER_ADDRESS # example http://host.docker.internal:8082
=== Container
# Build base image with rails application and all dependencies. Make sure
# to run this from the root directory of this repository.
docker build -t minond/captainslog-web-base -f web/Dockerfile .
# Build and run server application. Make sure you have a .env file with
# the required environment variables in the directory where you run this
# command.
docker build -t minond/captainslog-web -f web/Dockerfile.web .
docker run -d --env-file .env --name cl-web -p 8080:3000 minond/captainslog-web
# Build and run worker application.
docker build -t minond/captainslog-worker -f web/Dockerfile.worker .
docker run -d --env-file .env --name cl-worker minond/captainslog-worker
# Push to container repo.
docker push minond/captainslog-web:latest
docker push minond/captainslog-worker:latest