generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aaa13e0
commit 31ad971
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3.8' # Use the version of Docker Compose that you need | ||
|
||
services: | ||
postgresdb: | ||
image: postgres:latest # Use the latest PostgreSQL image | ||
container_name: postgresdb # Name your container | ||
environment: | ||
POSTGRES_USER: yourusername # Set the username for the PostgreSQL database | ||
POSTGRES_PASSWORD: yourpassword # Set the password for the PostgreSQL database | ||
POSTGRES_DB: yourdatabase # Set the name of the database | ||
ports: | ||
- "5432:5432" # Map the PostgreSQL port to the host | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data # Persist the data using a named volume | ||
|
||
volumes: | ||
postgres_data: | ||
driver: local # Use the local driver for the volume | ||
|