Skip to content

Commit

Permalink
docker is now supported here
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Reck committed Mar 29, 2024
1 parent f2ba7ce commit c078178
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# 2a5-app

See 2a5-api first

Docker container are running
See 2a5-api first and follow "Deploy Development (locally)"

2a5-api-development 3000
2a5-db-development 5432




# Development
You need to install on your local workstation:
- git
Expand Down Expand Up @@ -39,6 +35,13 @@ Start coding and open [http://localhost:3001](http://localhost:3001) with your b
Stop it with CTRL+C


# Run with Docker

The container will join the existing 2a5 network
```bash
docker compose up -d
```



# Cleanup locally
Expand Down
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: "3"
services:

app:
build:
context: .
dockerfile: Dockerfile
target: runner
hostname: 2a5-app-development
image: 2a5-app-development
ports:
- "3001:3001"
container_name: 2a5-app-development
environment:
- DOCKER_API_HOSTNAME=2a5-api-development
- DOCKER_API_PORT=3000
networks:
- 2a5-extern

networks:
2a5-extern:
name: 2a5
external: true
2 changes: 1 addition & 1 deletion pages/api/newUrlLong.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type SuccessType = {
}

async function doAPIRequest(urlLong: string) {
const endpoint = "http://localhost:3000/api/urlLong/new";
const endpoint = "http://" + ( process.env.DOCKER_API_HOSTNAME || "localhost" ) + ":" + ( process.env.DOCKER_API_PORT || "3000" ) + "/api/urlLong/new";
const payload = {
urlLong: urlLong
};
Expand Down

0 comments on commit c078178

Please sign in to comment.