Skip to content

Commit 1431944

Browse files
authored
Merge pull request #398 from plural/port-3100-for-dev
Use bin/setup in devcontainer and move to port 3100 for dev.
2 parents 6c9c13c + eb56393 commit 1431944

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
},
2929
// Use 'forwardPorts' to make a list of ports inside the container available locally.
3030
// This can be used to network with other containers or the host.
31-
"forwardPorts": [3000, 5432],
31+
"forwardPorts": [3100, 5432],
3232
// Use 'postCreateCommand' to run commands after the container is created.
33-
"postCreateCommand": "bundle install && bundle exec rake db:setup",
33+
"postCreateCommand": "./bin/setup",
3434
// Configure tool-specific properties.
3535
"customizations": {
3636
"vscode": {

.devcontainer/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ services:
1717
# (Adding the "ports" property to this file will not forward from a Codespace.)
1818

1919
environment:
20+
PORT: 3100
2021
POSTGRES_USER: postgres
2122
POSTGRES_DB: postgres
2223
POSTGRES_PASSWORD: postgres

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,16 @@ export DOCKER_DEFAULT_PLATFORM=linux/arm64/v8
3636

3737
```sh
3838
echo "RAILS_ENV=development" > .env
39+
echo "PORT=3100" >> .env
3940
cp config/database.example.yml config/database.yml
4041
docker network create null_signal
4142
docker compose build
4243
docker compose -f docker-compose.yml -f docker-compose.override.init.yml up -d
4344
```
4445

45-
Wait until `docker compose logs nrdb_api_server | tail` shows `Listening on http://0.0.0.0:3000`.
46+
Wait until `docker compose logs nrdb_api_server | tail` shows `Listening on http://0.0.0.0:3100`.
4647

47-
Test that `http://localhost:3000/api/docs/` loads in your browser. Afterwords,
48+
Test that `http://localhost:3100/api/docs/` loads in your browser. Afterwords,
4849

4950
```sh
5051
docker compose up -d
@@ -65,12 +66,12 @@ docker compose exec -e RAILS_ENV=test bundle exec rails db:seed
6566
## Getting Started
6667

6768
Once your server is running you can hit the api!
68-
ex. `http://localhost:3000/api/v3/public/cards/sure_gamble`
69+
ex. `http://localhost:3100/api/v3/public/cards/sure_gamble`
6970

7071
You can find the full list of routes here:
71-
`http://localhost:3000/rails/info/routes`
72+
`http://localhost:3100/rails/info/routes`
7273

73-
API Documentation will be available at `http://localhost:3000/api/docs/`.
74+
API Documentation will be available at `http://localhost:3100/api/docs/`.
7475

7576
Run `RAILS_ENV=test bundle exec rails db:reset` with `docker compose run` or in a
7677
shell in the container to load the fixture data for the tests.

docker-compose.override.init.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
services:
22

33
nrdb_api_server:
4+
ports:
5+
- "3100:3100"
6+
47
command:
58
- /bin/sh
69
- -c
710
- |
811
bundle exec rake db:reset
912
bundle exec rails cards:import
10-
bundle exec rails server -b 0.0.0.0
13+
bundle exec rails server -b 0.0.0.0 -p 3100

docker-compose.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ services:
1515
# build the Dockerfile next to this file, tag the built image with above image name
1616
build: .
1717

18-
ports:
19-
- "3000:3000"
20-
2118
networks:
2219
- backend
2320
- null_signal

0 commit comments

Comments
 (0)