From 6b3873fcbffef3ef2f3f9dd8b73a6bf8befa3468 Mon Sep 17 00:00:00 2001 From: Paul Cretu Date: Wed, 26 Jul 2023 11:22:27 -0700 Subject: [PATCH] Improve setup instructions in README (#151) * Add COMPOSE_FILE env instructions to README * minor edit * Add link to dev containers install --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9651882a..09ecdcb9 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Once you have one of these up and running, see the [Getting everything running]( #### Using VS Code -This project comes with a [devcontainer.json configuration](https://code.visualstudio.com/docs/devcontainers/containers) which can be used with VS Code. This takes care of all the `docker-compose` stuff in the background so you don't have to worry about it. When you open the project in VS Code, it should prompt you to start it in a dev container. Once the dev container starts, you can open a new terminal window in VS Code to run commands. See [the commands below](#getting-everything-running) for how to get everything started. +This project comes with a [devcontainer.json configuration](https://code.visualstudio.com/docs/devcontainers/containers) which can be used with VS Code. This takes care of all the `docker-compose` stuff in the background so you don't have to worry about it. When you open the project in VS Code, it should prompt you to start it in a dev container (assuming [you've installed docker and the dev containers extension](https://code.visualstudio.com/docs/devcontainers/containers#_installation)). Once the dev container starts, you can open a new terminal window in VS Code to run commands. See [the commands below](#getting-everything-running) for how to get everything started. #### Using docker-compose directly @@ -60,6 +60,15 @@ If you prefer not to use VS Code dev containers, the easiest way to develop in d docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d ``` +> **Note** +> You can also set the `COMPOSE_FILE` environment variable to avoid having to specify the compose files every time. This one-liner will do that for you no matter which subdirectory you're in: +> +> ``` +> export COMPOSE_FILE=`git rev-parse --show-toplevel`/docker-compose.yml:`git rev-parse --show-toplevel`/docker-compose.dev.yml +> ``` +> +> After setting COMPOSE_FILE, you can just run `docker-compose up -d` from anywhere in the project. + Once you have the services started, you can start a session inside the `web` container: ``` @@ -149,7 +158,6 @@ heroku run POOL_SIZE=2 iex -S mix The `POOL_SIZE` config var is necessary due to the current Postgres db having 20 connections. You can read more [about it here](https://hexdocs.pm/phoenix/heroku.html#creating-environment-variables-in-heroku). - ## Emails -Orcasite uses MJML for email templating. There are a few online MJML renderers, including: [mjml.io](https://mjml.io/try-it-live) and [grapes.js](https://grapesjs.com/demo-mjml.html) \ No newline at end of file +Orcasite uses MJML for email templating. There are a few online MJML renderers, including: [mjml.io](https://mjml.io/try-it-live) and [grapes.js](https://grapesjs.com/demo-mjml.html)