From 5f4281af7be79b4371a1e2c92e8377a6b5512317 Mon Sep 17 00:00:00 2001 From: Dave Wilson Date: Sun, 26 Feb 2023 16:49:47 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Include=20a=20Client=20container?= =?UTF-8?q?=20in=20docker=20compose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/README.md | 19 +++++++++++++++++-- Server/docker-compose.yml | 14 +++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/Server/README.md b/Server/README.md index 3d3ba5f2..1ce0e92c 100644 --- a/Server/README.md +++ b/Server/README.md @@ -2,7 +2,8 @@ In this folder, `Dockerfile` runs the Flask Server in a container. -The `docker-compose.yml` defines a cluster with the Server and a local PostgreSQL container +The `docker-compose.yml` defines a cluster with the Server and a local PostgreSQL container. +It also runs as well as a client, assuming that the client is in `../client` from this location. For convenience, a Makefile supports the following simple operations: @@ -29,7 +30,7 @@ The problem was the use of the `slim-` base image. Switching from `p`ython:3.9. ### Ventura - Flask default port 5000 -Flask runs by default on port 5000. However, on macos Ventura, there is a system service "Airplay Receiver" listening on this port. +Flask runs by default on port 5000. However, on macOS Ventura, there is a system service "Airplay Receiver" listening on this port. In this case, `localhost:5000` does not reach the Flask app, although `127.0.0.1:5000` does. @@ -37,6 +38,20 @@ The easiest solution is to turn off the Airplay Receiver service; an alternative [Here's a full discussion of the issue](https://blog.yimingliu.com/2023/01/01/cannot-connect-to-flask-development-server-on-localhost-port-5000/). +### Supabase, local + +Following the guidance [here](https://supabase.com/docs/guides/self-hosting/docker) I was able to get Supabase running locally. + +``` +git clone --depth 1 https://github.com/supabase/supabase +cd supabase/docker +cp .env.example .env +docker compose up +``` + +However, the vanilla installation is complicated, unconfigured and potentially of limited utility. + + ## Current Issue The server responds to `http://localhost:5000` with a classic "Hello World" diff --git a/Server/docker-compose.yml b/Server/docker-compose.yml index df89f327..d1a3aa0b 100644 --- a/Server/docker-compose.yml +++ b/Server/docker-compose.yml @@ -28,7 +28,19 @@ services: - "5432" networks: - back-tier + client: + build: + context: ../../client + ports: + - "3000:3000" + expose: + - "3000" + depends_on: + - server + networks: + - front-tier + - back-tier networks: - # front-tier: {} + front-tier: {} back-tier: {} \ No newline at end of file