From 5f4ae766c78ab64a7a4518137fd23778142e7074 Mon Sep 17 00:00:00 2001 From: Zhanna Klimanova Date: Sun, 30 Jun 2024 16:03:40 -0400 Subject: [PATCH] refactor: remove PORT environment variable Refs: #103 --- .env.sample | 1 - README.md | 4 ++-- docker-compose.yml | 2 +- nginx/nginx.conf | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.env.sample b/.env.sample index d95d0f0..0e037bc 100644 --- a/.env.sample +++ b/.env.sample @@ -2,7 +2,6 @@ VERSION=0.1.0 DEVELOPMENT=false HOST_NAME=vim.linkedmusic.ca -PORT=8000 ## WEB APP ## #DJANGO_SECRET_KEY=ADD DJANGO SECRET KEY HERE diff --git a/README.md b/README.md index 6d7b784..e314994 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ NOTE: These instructions are for local development only. Refer to the "Installat - UMIL requires Docker Engine with Compose V2. Verify your version with `docker compose --version` and look for an output such as `Docker Compose version v2.19.1`. If you do not have the correct version, refer to the [Docker Compose Migration Documentation](https://docs.docker.com/compose/migrate/). ### Initial Set-up Instructions -After cloning this repository, you will need a local `.env` file at the root of the directory. Copy the contents or rename the `.env.sample` file to `.env` and update it to include uncommented environment variables for the database credentials `POSTGRES_USER` and `POSTGRES_PASSWORD`, as well as the `DJANGO_SECRET_KEY`. The database credentials can be set to anything while the `DJANGO_SECRET_KEY` will need to be obtained from one of the developers working on the UMIL project. Next you will need to verify the values of the `DEVELOPMENT`, `HOST_NAME`, and `PORT` variables. For local development ONLY, these should be set to "true", "localhost", and "8000" respectively. \ +After cloning this repository, you will need a local `.env` file at the root of the directory. Copy the contents or rename the `.env.sample` file to `.env` and update it to include uncommented environment variables for the database credentials `POSTGRES_USER` and `POSTGRES_PASSWORD`, as well as the `DJANGO_SECRET_KEY`. The database credentials can be set to anything while the `DJANGO_SECRET_KEY` will need to be obtained from one of the developers working on the UMIL project. Next you will need to verify the values of the `DEVELOPMENT` and `HOST_NAME` variables. For local development ONLY, these should be set to "true" and "localhost", respectively. \ In one terminal run the following commands to build the docker images and run the specified services. ```sh docker compose build @@ -50,7 +50,7 @@ UMIL requires Docker Engine with Compose V2. Ensure that the remote server has t SSH into the server. After cloning the repository, set up a local `.env` file. Copy or rename the `.env.sample` file to `.env` and update it to include uncommented environment variables for database credentials `POSTGRES_USER` and `POSTGRES_PASSWORD`. Ensure that `POSTGRES_PASSWORD` is secure. Additionally, set `DJANGO_SECRET_KEY` with a secure secret key for Django. -Ensure that the `DEVELOPMENT` variable is set to "false", and that `HOST_NAME` is set to the host name where the UMIL instance will be served (for example, "vim.linkedmusic.ca" or "vim.staging.linkedmusic.ca"). Set the `PORT` variable to "80". +Ensure that the `DEVELOPMENT` variable is set to "false", and that `HOST_NAME` is set to the host name where the UMIL instance will be served (for example, "vim.linkedmusic.ca" or "vim.staging.linkedmusic.ca"). Run the following commands: ```bash diff --git a/docker-compose.yml b/docker-compose.yml index 646a49a..4d4d1da 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,7 +45,7 @@ services: environment: - HOST_NAME=${HOST_NAME} ports: - - "${PORT}:80" + - "8000:80" volumes: - vim-static:/virtual-instrument-museum/static depends_on: diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 427bad9..b8aad0b 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -5,7 +5,7 @@ error_log /var/log/nginx/error.log warn; # piped to Docker log collector (see n pid /var/log/nginx/nginx.pid; events { - accept_mutex off; + accept_mutex off; } http {