Skip to content

Commit 9b344ff

Browse files
authored
Update README with simplified instructions (including Windows setup) (#956)
* Add Windows docker troubleshooting link to README Addresses the docker error I was encountering Signed-off-by: Dave Thaler <dthaler1968@gmail.com> * Update link Signed-off-by: Dave Thaler <dthaler1968@gmail.com> * Add more Windows OS notes Signed-off-by: Dave Thaler <dthaler1968@gmail.com> * Remove sections on docker-compose and running directly Signed-off-by: Dave Thaler <dthaler1968@gmail.com> * Update devcontainer.json with elixirLS settings Signed-off-by: Dave Thaler <dthaler1968@gmail.com> * Replace docker-compose with docker compose Addresses a PR comment Signed-off-by: Dave Thaler <dthaler1968@gmail.com> * Revert unnecessary sentence. Signed-off-by: Dave Thaler <dthaler1968@gmail.com> --------- Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
1 parent 695741c commit 9b344ff

File tree

2 files changed

+17
-78
lines changed

2 files changed

+17
-78
lines changed

.devcontainer/devcontainer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
// The optional 'workspaceFolder' property is the path VS Code should open by default when
1919
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
20-
"workspaceFolder": "/app"
20+
"workspaceFolder": "/app",
2121

2222
// Features to add to the dev container. More info: https://containers.dev/features.
2323
// "features": {},
@@ -35,7 +35,13 @@
3535
// "postCreateCommand": "cat /etc/os-release",
3636

3737
// Configure tool-specific properties.
38-
// "customizations": {},
38+
"customizations": {
39+
"vscode": {
40+
"settings": {
41+
"elixirLS.projectDir": "/app/server"
42+
}
43+
}
44+
},
3945

4046
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
4147
// "remoteUser": "devcontainer"

README.md

Lines changed: 9 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,23 @@ Please check out the [CONTRIBUTING](CONTRIBUTING.md) doc for tips on making a su
1515

1616
## Quick Start
1717

18-
1. Load the Docker Configuration: `docker-compose up`
18+
1. Load the Docker Configuration: `docker compose up`
1919
2. Wait for containers to start up
2020
3. Navigate to [localhost:3000](http://localhost:3000) to view the website
2121
4. Navigate to [localhost:4000](http://localhost:4000) to access the API server
2222

2323
> **Note**
24-
> This assumes you have installed [docker](https://docs.docker.com/engine/install/) and [docker-compose](https://docs.docker.com/compose/install/).
24+
> This assumes you have installed [docker](https://docs.docker.com/engine/install/). If you're running Windows,
25+
> ensure [Docker Desktop](https://docs.docker.com/desktop/setup/install/windows-install/) is installed and running.
2526
2627
### Running in Docker
2728

28-
Docker is the quickest way to get the project up and running, especially if you haven't already set up Erlang/Elixir/Node. The only requirement is that you have both [docker](https://docs.docker.com/v17.09/engine/installation/) and [docker-compose](https://docs.docker.com/compose/install/) installed on your machine.
29+
Docker is the quickest way to get the project up and running, especially if you haven't already set up Erlang/Elixir/Node. The only requirement is that you have [docker](https://docs.docker.com/engine/install/) installed on your machine.
2930

30-
Once you clone the repository, you can just run docker-compose in the root directory:
31+
Once you clone the repository, you can just run `docker compose` in the root directory:
3132

3233
```shell
33-
docker-compose up
34+
docker compose up
3435
```
3536

3637
This will build an image locally with all the dependencies you need. It will also pull a pre-built image from [Docker Hub](https://hub.docker.com/r/orcasound/orcasite) for the database, automatically configure everything, and both the Phoenix and Next.js servers. The orcasite page will be accessible at [`http://localhost:3000`](http://localhost:3000) as soon as the `web` container finishes starting up.
@@ -39,19 +40,9 @@ This will build an image locally with all the dependencies you need. It will als
3940

4041
The [quick start](#quick-start) setup is great for getting the project up and running, but if you want to do development, you'll want to be able to modify the source code without re-building an entire Docker image.
4142

42-
### Setup options
43+
### Setup
4344

44-
There are several options for how to set up your dev environment:
45-
46-
- [VS Code with dev containers](#using-vs-code)
47-
- [Using docker-compose](#using-docker-compose-directly)
48-
- [Directly on your machine](#set-up-directly-on-machine)
49-
50-
Once you have one of these up and running, see the [Getting everything running](#getting-everything-running) section for how to start the project.
51-
52-
#### Using VS Code
53-
54-
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.
45+
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.
5546

5647
> **Tip**
5748
> For a better VS Code experience, copy the example settings file:
@@ -62,64 +53,6 @@ This project comes with a [devcontainer.json configuration](https://code.visuals
6253
>
6354
> This provides recommended editor settings for this project. You can also see & install recommended extensions by opening the command palette (Cmd+Shift+P) and selecting "Extensions: Show Recommended Extensions".
6455
65-
#### Using docker-compose directly
66-
67-
If you prefer not to use VS Code dev containers, the easiest way to develop in docker is by starting up docker-compose manually (using the dev compose file):
68-
69-
```shell
70-
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
71-
```
72-
73-
> **Note**
74-
> 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:
75-
>
76-
> ```shell
77-
> export COMPOSE_FILE=`git rev-parse --show-toplevel`/docker-compose.yml:`git rev-parse --show-toplevel`/docker-compose.dev.yml
78-
> ```
79-
>
80-
> After setting COMPOSE_FILE, you can just run `docker-compose up -d` from anywhere in the project.
81-
82-
Once you have the services started, you can start a session inside the `web` container:
83-
84-
```shell
85-
docker-compose exec web bash
86-
```
87-
88-
From here you can run the [commands below](#getting-everything-running) to get everything started.
89-
90-
> **Note**
91-
> The `docker-compose` setup uses bind mounting for the source files, which means if you edit the source on your host file system, the changes will get picked up and live reloaded in your browser.
92-
93-
#### Set up directly on machine
94-
95-
If Docker doesn't suit your needs, you can follow these instructions to get everything running directly on your machine.
96-
97-
##### Language
98-
99-
You will need to install Erlang, Elixir, and Node.js. You can use a tool like [`asdf`](https://github.com/asdf-vm/asdf) to manage your language dependencies.
100-
101-
Language-level dependencies can be found under `.tool-versions`.
102-
103-
##### Database
104-
105-
You will need to install Postgres and set up the `postgres` user with a password. The default connection details are:
106-
107-
```text
108-
username: "postgres"
109-
password: "postgres"
110-
database: "orcasite_dev"
111-
hostname: "localhost"
112-
port: 5432
113-
```
114-
115-
You can pass in custom values using env variables. Full details can be found in [`dev.exs`](config/dev.exs).
116-
117-
Orcasite uses [PostGIS](http://postgis.net/) for location data inside of Postgres. To install on MacOS, run
118-
119-
```shell
120-
brew install postgis
121-
```
122-
12356
### Getting everything running
12457
12558
Once you have your environment setup via one of the options above, you can start the project. You'll need to run both the Phoenix server and the Next.js server.
@@ -157,7 +90,7 @@ Once everything finishes starting up, you'll be able to access the UI at [`http:
15790
The development environment automatically seeds the database with real data from the production server, including detections, audio images, and other records. This happens via background jobs that sync data every 1 minute.
15891
15992
> **Note:**
160-
> Seeded resources will only work with feeds that match production (i.e. with the same `id` and `slug`). Clear your data with `mix ecto.drop` and re-initialize it with `mix ecto.setup` to get the latest data from the production servers.
93+
> Seeded resources will only work with feeds that match production (i.e., with the same `id` and `slug`). Clear your data with `mix ecto.drop` and re-initialize it with `mix ecto.setup` to get the latest data from the production servers.
16194
16295
### Seeding on setup
16396

0 commit comments

Comments
 (0)