Skip to content
Open
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

.idea/
.vscode/

*.json
*.toml
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ docker network create --driver bridge masterbase-network
Build the DB:

```sh
docker build -f Dockerfile.db . -t db
docker build -f database.Dockerfile . -t db
```

Run the DB:
Expand All @@ -160,7 +160,7 @@ pdm run alembic upgrade head
Build the API:

```sh
docker build -f Dockerfile.api . -t api
docker build -f api.Dockerfile . -t api
```

Now before we run, we need to inject the IPv4 of the db container. We can find this by running `docker network inspect masterbase-network` and inspecting the output. In my case, I see the IP as `172.20.0.2`
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions build.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
POSTGRES_USER=MEGASCATTERBOMB
POSTGRES_PASSWORD=masterbase
POSTGRES_HOST=172.20.1.10
POSTGRES_PORT=5432
API_HOST=172.20.1.20
DEVELOPMENT=true
42 changes: 42 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: masterbase

services:
api:
container_name: masterbase-api
env_file:
- ./build.env
build:
dockerfile: api.Dockerfile
args:
DEVELOPMENT=${DEVELOPMENT}
links:
- db
restart: unless-stopped
ports:
- 8000:8000
networks:
masterbase-network:
ipv4_address: ${API_HOST}

db:
container_name: masterbase-db
env_file:
- ./build.env
build:
dockerfile: database.Dockerfile
restart: unless-stopped
ports:
- 8050:${POSTGRES_PORT}
networks:
masterbase-network:
ipv4_address: ${POSTGRES_HOST}

networks:
masterbase-network:
name: masterbase-network-dev
driver: bridge
ipam:
driver: default
config:
- subnet: 172.20.0.0/16
gateway: 172.20.0.1
File renamed without changes.