Skip to content

Latest commit

 

History

History
84 lines (76 loc) · 1.34 KB

File metadata and controls

84 lines (76 loc) · 1.34 KB

How to create postgres with docker file

1.Create repository

  • create on github account

2. Clone repository to your machine

git clone {url-of-repo}

3.Create README.md file

nano README.md | open with IDE on your machine
# Python Prisma

Prawee Wongsa

4.Define env

4.1 create env.simple file

nano env.simple | open with IDE on your machine
# Database
DATABASE_PORT=modified
DATABASE_NAME=modified
DATABASE_PASSWORD=modified
DATABASE_USER=modified

4.2 update README.md file

nano README.md | open with IDE on your machine
...
## Using it
### Windows
copy env.simple .env
### Mac / Linux
cp env.simple .env

5. Ignore env

nano .gitignore | open with IDE on your machine
.env

6.Create db.yml

6.1 create db.yml

nano db.yml
services:
  db:
    image: postgres:latest
    container_name: my_db_prisma
    environment:
      POSTGRES_USER: ${DATABASE_USER}
      POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
      POSTGRES_DB: ${DATABASE_NAME}
    ports:
      - "${DATABASE_PORT}:5432"

6.2 update readme file

nano README.md
docker compose -f db.yml up -d

7.Backup branch

git checkout -b "1-create-postgres-db"
git push -u origin 1-create-postgres-db
git checkout develop