A brief description of what the application does and its purpose.
- Docker (Ensure Docker is installed and running on your machine)
- PgAdmin (optional) Install this to view your database.
-
Clone the Repository and install the dependencies if developing
git clone https://github.com/anujshandillya/subtext.git cd subtext yarn install
-
Pull the postgres:14-alpine(lightweight) image from Docker hub
docker pull postgres:14-alpine
-
Create a Volume persisting db data
docker volume create <volume_name>
-
Create a Container for your postgres server attaching volume and all environment variables
docker run -v <volume_name>:/var/lib/postgresql/data --name <container_name> -e POSTGRES_USER=<username> -e POSTGRES_PASSWORD=<password> -e POSTGRES_DB=<db_name> -p <machine_port>:<container_port> -d postgres:14-alpine
Say, container_name=postDB, POSTGRES_USER=xyz, POSTGRES_PASSWORD=abcd, POSTGRES_DB=postgres, volume_name=test then it will look like this if you map your machine port(say 5432) to container port(5432).
docker run -v test:/var/lib/postgresql/data --name postDB -e POSTGRES_USER=xyz -e POSTGRES_PASSWORD=abcd -e POSTGRES_DB=postgres -p 5432:5432 -d postgres:14-alpine
Setup environment variables
DATABASE_URL="postgresql://<username>:<password>@localhost:{PORT}/postgres?schema=public" GOOGLE_CLIENT_SECRET="" GOOGLE_CLIENT_ID="" JWT_SECRET="" AWS_S3_ACCESS_KEY="" AWS_S3_SECRET_ACCESS_KEY="" S3_BUCKET_NAME=""