@@ -167,6 +167,50 @@ anyone can experiment with, just please don't rely on it for production!
167167
168168There is also a button above to easily deploy your own copy of the application to Heroku.
169169
170+ ### Docker
171+
172+ A Dockerfile is provided to run the application within a container. To
173+ build the image, navigate to the root of the repo and run ` docker build ` :
174+
175+ ``` bash
176+ docker build . -t avro-schema-registry
177+ ```
178+
179+ The container is built for the ` production ` environment, so you'll
180+ need to pass in a few environment flags to run it:
181+
182+ ``` bash
183+ docker run -p 5000:5000 -d \
184+ -e DATABASE_URL=postgresql://user:pass@host/dbname \
185+ -e FORCE_SSL=false \
186+ -e SECRET_KEY_BASE=supersecret \
187+ -e SCHEMA_REGISTRY_PASSWORD=avro \
188+ avro-schema-registry
189+ ```
190+
191+ If you also want to run PostgreSQL in a container, you can link the two containers:
192+
193+ ``` bash
194+ docker run --name avro-postgres -d \
195+ -e POSTGRES_PASSWORD=avro \
196+ -e POSTGRES_USER=avro \
197+ postgres:9.6
198+
199+ docker run --name avro-schema-registry --link avro-postgres:postgres -p 5000:5000 -d \
200+ -e DATABASE_URL=postgresql://avro:avro@postgres/avro \
201+ -e FORCE_SSL=false \
202+ -e SECRET_KEY_BASE=supersecret \
203+ -e SCHEMA_REGISTRY_PASSWORD=avro \
204+ avro-schema-registry
205+ ```
206+
207+ To setup the database the first time you run the app, you can call
208+ ` rails db:setup ` from within the container:
209+
210+ ``` bash
211+ docker exec avro-schema-registry bundle exec rails db:setup
212+ ```
213+
170214## Security
171215
172216The service is secured using HTTP Basic authentication and should be used with
@@ -241,4 +285,3 @@ This code is available as open source under the terms of the
241285
242286Bug reports and pull requests are welcome on GitHub at
243287https://github.com/salsify/avro-schema-registry .
244-
0 commit comments