Skip to content

Commit

Permalink
Document Docker in DEVELOPMENT.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ddimaria committed Jan 25, 2024
1 parent 0f175b0 commit 126e830
Showing 1 changed file with 47 additions and 37 deletions.
84 changes: 47 additions & 37 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@

Let's get everything setup to develop on Quadratic!

- [Developing without Docker](#developing-without-docker)
- [Installing PostgreSQL](#installing-postgresql)
- [Mac](#mac)
- [Create Database](#create-database)
- [Installing Redis](#installing-redis)
- [Mac](#mac-1)
- [Using node dev](#using-node-dev)
- [Commands while `node dev` is running](#commands-while-node-dev-is-running)
- [Running for React-only development](#running-for-react-only-development)
- [Install Dependencies](#install-dependencies)
- [Local Environment Setup](#local-environment-setup)
- [Docker](#docker)
- [Docker Compose](#docker-compose)
- [Building Images Manually](#building-images-manually)
- [Developing without Docker](#developing-without-docker)
- [Installing PostgreSQL](#installing-postgresql)
- [Mac](#mac)
- [Create Database](#create-database)
- [Installing Redis](#installing-redis)
- [Mac](#mac-1)
- [Using node dev](#using-node-dev)
- [Commands while `node dev` is running](#commands-while-node-dev-is-running)
- [Running for React-only development](#running-for-react-only-development)


## Install Dependencies
Expand All @@ -36,61 +41,66 @@ rustup target add wasm32-unknown-unknown
cargo install cargo-watch
```

## Docker Compose
## Local Environment Setup

To build images for individual services (from project root):
Now that dependencies are installed, all you need to do is run `node dev` to
bring up the all services. INvoke `node run --help` for information on how
to use this script, as you can use it to watch individual (or groups of)
services during development. See the [Using node dev](Using-node-dev) section
for more more information.

```shell
docker-compose build quadratic-api
docker-compose build quadratic-files
docker-compose build quadratic-multiplayer
```
### Docker

#### Docker Compose

Docker Compose is a utility that's built into Docker Desktop and is a compact
infrastructure-as-code framework. Services (e.g. running Docker containers) are
defined, along with configuration information, in the `docker-compose.yml` file.
Service can talk together and can communicate with services in the user's host
network.

To pull up the network with just the required depedencies (Redis, Postgres, Localstack):

```shell
docker compose up
npm run docker:up
```

To run the network in the background, add the `-d` command to the end:

```shell
docker compose up -d
```
Along with the dependent services, scripts are executed that create S3 buckets and
migrate the database. Docker is run in the background in this script.

## Develop on the Frontend

## Develop on Quadratic API

## Develop on Quadratic Core
#### Building Images Manually

## Develop on Quadratic MultiPlayer
To build images for individual services (from project root):

## Develop on Quadratic Files
```shell
docker-compose build quadratic-api
docker-compose build quadratic-files
docker-compose build quadratic-multiplayer
```

# Developing without Docker
### Developing without Docker

You can also develop Quadratic without using docker

- [Install Dependencies](#install-dependencies)
- Set up .env in quadratic-client, quadratic-api, quadratic-multiplayer, and quadratic-files. (todo: better description of how to do this)
* Set up .env in quadratic-client, quadratic-api, quadratic-multiplayer, and quadratic-files. (todo: better description of how to do this)

## Installing PostgreSQL
#### Installing PostgreSQL

### Mac
##### Mac

`brew install postgresql` (Mac)
`brew services start postgresql`

### Create Database
##### Create Database

- Create a database for use with postgres
- Add database to quadratic-api/.env
* Create a database for use with postgres
* Add database to quadratic-api/.env

## Installing Redis
#### Installing Redis

### Mac
##### Mac

`brew install redis`
`brew services start redis`
Expand Down

0 comments on commit 126e830

Please sign in to comment.