Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev-tools/create-test-database
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -euo pipefail

docker-compose exec -T postgres psql -h localhost -p 5432 -U spoke spokedev <<EOF
docker compose exec -T postgres psql -h localhost -p 5432 -U spoke spokedev <<EOF
CREATE DATABASE spoke_test;
CREATE USER spoke_test WITH PASSWORD 'spoke_test';
GRANT ALL PRIVILEGES ON DATABASE spoke_test TO spoke_test;
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/psql
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

set -euo pipefail

docker-compose exec postgres psql -h localhost -p 5432 -U spoke spokedev "$@"
docker compose exec postgres psql -h localhost -p 5432 -U spoke spokedev "$@"
2 changes: 1 addition & 1 deletion dev-tools/redis-cli
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ set -euo pipefail
# * To open a shell: ./dev-tools/redis-cli
# * To clear the cache: ./dev-tools/redis-cli FLUSHDB

docker-compose exec redis redis-cli "$@"
docker compose exec redis redis-cli "$@"
2 changes: 1 addition & 1 deletion docs/HOWTO-run_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ There are current two ways to run tests, using either PostgreSQL or SQLite.
### Running Postgres with Docker (recommended)

1. Install [Docker](https://docs.docker.com/desktop/)
2. Run redis and postgres using docker-compose: `docker-compose up`
2. Run redis and postgres using docker compose: `docker compose up`
3. Create the test database: `./dev-tools/create-test-database`
4. Run `yarn test`

Expand Down
2 changes: 1 addition & 1 deletion docs/HOWTO_AZURE_DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ It turns out we need those instructions for a different portion of the setup, bu
- Install Docker for preliminary database and cache setup, [linked here](https://docs.docker.com/engine/install/ubuntu/)
- Verify your docker is set up correctly: $ sudo docker run hello-world
- Install docker compose (click on the Linux tab) [Link to Docker Documentation](https://docs.docker.com/compose/install/)
- Turn on docker `sudo docker-compose up -d`
- Turn on docker `sudo docker compose up -d`
- Permission Denied Sad Path: `sudo usermod -aG docker $USER` (theoretically making it so you don’t have to use sudo, but let’s come back to this)
Yarn bug: `wget -qO- https://github.com/nvm-sh/nvm/v0.38.0/install.sh | bash
https://github.com/StateVoicesNational/Spoke/blob/main/docker-compose.yml`
Expand Down
7 changes: 4 additions & 3 deletions docs/HOWTO_DEVELOPMENT_LOCAL_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ Docker is optional, but can help with a consistent development environment using
- Docker allows you to run apps in containers and can be installed [here with Docker's instructions](https://docs.docker.com/desktop/)
- Docker Compose is the tool used to create and run docker configurations. If you installed Docker on Mac, you already have Docker Compose, if you're using Linux or Windows you can install Docker Compose [with these instructions](https://docs.docker.com/compose/install/)

2. Make sure Docker is running on your machine and then build and run Spoke with `docker-compose up -d` to run redis and postgres in the background
- You can stop docker compose at any time with `docker-compose down`, and data will persist next time you run `docker-compose up`.
2. Make sure Docker is running on your machine and then build and run Spoke with `docker compose up -d` to run redis and postgres in the background
- You can stop docker compose at any time with `docker compose down`, and data will persist next time you run `docker compose up`.
- **Note!** - `docker-compose` should in theory work with ComposeV2 as Docker considers it an alias for `docker compose`. [Read more about the migration of Compose](https://docs.docker.com/compose/migrate/#what-does-this-mean-for-my-projects-that-use-compose-v1)

3. Run `./dev-tools/create-test-database` to populate the test database

4. When done testing, clean up resources with `docker-compose down`, or `docker-compose down -v` to **_completely destroy_** your Postgres database & Redis datastore volumes.
4. When done testing, clean up resources with `docker compose down`, or `docker compose down -v` to **_completely destroy_** your Postgres database & Redis datastore volumes.

### Getting the app running

Expand Down
2 changes: 1 addition & 1 deletion docs/HOWTO_USE_POSTGRESQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
To use Postgresql, follow these steps:

1. Either install docker (recommended) or postgresql on your machine:
* If you installed docker run the database using: `docker-compose up`
* If you installed docker run the database using: `docker compose up`
* If you installed postgres locally, create the spoke dev database: `psql -c "create database spokedev;"`
* Then create a spoke user to connect to the database with `createuser -P spoke` with password "spoke" (to match the credentials in the .env.example file)
1. In `.env` set `DB_TYPE=pg`. (Otherwise, you will use sqlite.)
Expand Down