Skip to content

Docker using compose, configuration file with environment variables and creating a container, in addition the data are present on the local machine even after restart or re created the container

Notifications You must be signed in to change notification settings

jadilson12/docker-compose-postgres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Docker using compose, configuration file with environment variables and creating a container, in addition the data are present on the local machine even after restart or re created the container :

  • postgres:12

Postgres Container Configuration

  1. Expose port

    • 5432
  2. Volume (Note: check if in the docker configuration -> shared drivers, the units are enabled)

    • Application database: ./docker/postgres/data -> /var/lib/postgresql/data
    • Automatically create schema: ./docker/schema.sql -> /docker-entrypoint-initdb.d/0.schema.sql

How to use

  1. Clone the repository using the command:
$ git clone https://github.com/jadilson12/docker-compose-postgres
  1. Enter the folder docker-compose-postgres copy the files
$ cp env-example .env
$ cp docker-compose.yml-example docker-compose.yml
  1. Run your container:
$ docker-compose up -d
  1. Access the container shell:
$ docker exec -it app-database sh

Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

Author

Jadilson Guedes jadilson12@gmail.com
License MIT https://jadilson12.mit-license.org/

About

Docker using compose, configuration file with environment variables and creating a container, in addition the data are present on the local machine even after restart or re created the container

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published