Skip to content

Commit

Permalink
refactor: better organized docker installation
Browse files Browse the repository at this point in the history
  • Loading branch information
borolepratik committed Feb 11, 2024
1 parent 210a94b commit 6d63a94
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,5 @@ cython_debug/
#.idea/

# Supabase self-host
volumes/db/data
volumes/storage
docker/volumes/db/data
docker/volumes/storage
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# required in order for supabase-kong to work
volumes/api/kong.yml
docker/volumes/api/kong.yml
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Table of Contents:
- [Setting up the project](#setting-up-the-project)
- [What you'll need](#what-youll-need)
- [Development](#development)
- [Environment variables](#environment-variables)
- [Python virtual environment](#python-virtual-environment)
- [Installing dependencies](#installing-dependencies)
- [Virtual environment sanity check](#virtual-environment-sanity-check)
Expand All @@ -33,6 +34,10 @@ Table of Contents:

## Development

### Environment variables

In `/docker`, create a copy of `.env.example` as `.env`.

### Python virtual environment

#### Installing dependencies
Expand Down Expand Up @@ -77,15 +82,16 @@ pre-commit install --hook-type commit-msg --hook-type pre-push --hook-type pre-c
```
- Run container
```sh
docker run --detach --name backend-dev --publish 8081:8081 backend-dev
docker run --name backend-dev --publish 8081:8081 backend-dev --detach
```
- Open your browser at `http://localhost/8081`.

#### With Supabase

- Bring up the services
```sh
docker compose --detach --file compose.dev.yaml up
cd docker
docker compose --file compose.dev.yaml up --detach
```
- Open your browser at
- `http://localhost/8081` for app
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion compose.dev.yaml → docker/compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ services:
app:
container_name: backend-dev
build:
context: .
context: ..
dockerfile: Dockerfile.dev
ports:
- "8081:8081"
env_file:
- .env
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions useful_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ docker build --file Dockerfile.prod --tag backend-prod .
#### Start the containers

```sh
docker run --detach --name backend-dev --publish 8081:8081 backend-dev
docker run --detach --name backend-staging --publish 80:80 backend-staging
docker run --detach --name backend-prod --publish 80:80 backend-prod
docker run --name backend-dev --publish 8081:8081 backend-dev --detach
docker run --name backend-staging --publish 80:80 backend-staging --detach
docker run --name backend-prod --publish 80:80 backend-prod --detach
```

#### Stop the containers
Expand Down Expand Up @@ -113,12 +113,12 @@ docker compose --file compose.dev.yaml build
#### Bring up the services

```sh
docker compose --detach --file compose.dev.yaml up
docker compose --file compose.dev.yaml up --detach
```


#### Build and bring up the services

```sh
docker compose --detach --file compose.dev.yaml up --build
docker compose --file compose.dev.yaml up --build --detach
```

0 comments on commit 6d63a94

Please sign in to comment.