Code2Gether-Discord / JokesOnYou

A learning project, A jokes website build as a team project.
12 stars 11 forks source link

Adding Docker Compose #118

Closed stutwoby closed 3 years ago

stutwoby commented 3 years ago

Docker Compose

What did I do?

We currently have a repo that requires a connection to a database. It's an annoying experience having to set up a local database and mess around with configuring everything. I've added docker support to build both the app and database and spin up containers with connections between them.

How did I do it?

docker compose, you can add individual docker files to projects, reference them and build them. You can also pull down images from docker hub. In this case, we wanted to reference Postgres which is what I've done. We set up a bridge between the two, pass a connection string and bam, got a lovely database spun up locally without any setup (apart from docker).

Thankfully, we've already got some seeded data, so I've plumbed it in, so we check if the database is created on startup. If not we migrate and populate.

bschaatsbergen commented 3 years ago

Nice innovative idea!