From d718fc0020661ae84df56ac42c6678980a563e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Pr=C3=A9vost?= Date: Sat, 17 Feb 2024 21:35:35 -0500 Subject: [PATCH] Fix docker compose setup to build locally instead of using linux/amd64 arch everywhere --- README.md | 5 +++-- docker-compose.yml | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d67b27e9..8edb4af6 100644 --- a/README.md +++ b/README.md @@ -103,13 +103,14 @@ The Makefile should be the main entry for common tasks such as tests, linting, D For the production setup, we use Docker to build an OTP release of the app. With docker-compose, you can run the image locally. Here are the steps to have a working app running locally with Docker: -_When running the production env, you need to provide a valid GOOGLE_API_CLIENT_ID in the `docker-compose.yml` file._ +_When running the production env, you need to provide a valid authentication setup in the `environment` section in `docker-compose.yml` file._ +See the following sections to see available variables to enable third-party logins or dummy login (email only, no password). 1. Run `make build` to build the OTP release with Docker 2. Run `make dev-start-postgresql` to start an instance of Postgresql. The instance will run on port 5432 with the `postgres` user. You can change those values in the `docker-compose.yml` file. 3. Run `make dev-start-application` to start the app! The release hook of the release will execute migrations and seeds before starting the webserver on port 4000 (again you can change the settings in `docker-compose.yml`) -_That’s it! You now have a working Accent instance without installing Elixir or Node!_ +_That’s it! You now have a working Accent instance without installing Elixir or NodeJS!_ ## 🌳 Environment variables diff --git a/docker-compose.yml b/docker-compose.yml index 399c6476..05a282d9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,8 @@ version: '3.7' services: application: - image: mirego/accent container_name: accent + network_mode: "host" build: . ports: - 4000:4000 @@ -10,9 +10,9 @@ services: - postgresql environment: - PORT=4000 - - DATABASE_URL=postgres://postgres@postgresql:5432/accent_development + - DATABASE_URL=postgres://postgres@localhost:5432/accent_development postgresql: - image: postgres:10.3 + image: postgres:15.6 container_name: accent-postgres environment: - POSTGRES_DB=accent_development