Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 2.03 KB

File metadata and controls

57 lines (41 loc) · 2.03 KB

PostgreSQL Workflow Example

This project demonstrates how to build and push a PostgreSQL Docker image using GitHub Actions. It includes a Dockerfile for creating the PostgreSQL image and a GitHub Actions workflow for automating the build and push process.

Project Structure

postgresql-workflow-example
├── .github
│   └── workflows
│       └── postgres-image.yml  # GitHub Actions workflow for building and pushing the Docker image
├── docker
│   └── Dockerfile                # Dockerfile for PostgreSQL image
├── src
│   └── app.js                   # Main application file for connecting to the PostgreSQL database
├── package.json                  # npm configuration file
└── README.md                     # Project documentation

Getting Started

To get started with this project, follow these steps:

  1. Clone the repository:

    git clone <repository-url>
    cd postgresql-workflow-example
  2. Build the Docker image: Navigate to the docker directory and build the image using the Dockerfile:

    cd docker
    docker build -t your-postgres-image-name .
  3. Run the Docker container: After building the image, you can run it with:

    docker run --name your-container-name -e POSTGRES_PASSWORD=yourpassword -d your-postgres-image-name

GitHub Actions Workflow

The GitHub Actions workflow defined in .github/workflows/postgres-image.yml automates the process of building and pushing the Docker image to a container registry whenever changes are pushed to the main branch.

Usage

You can connect to the PostgreSQL database using the credentials specified in the Docker run command. The main application logic can be found in src/app.js, where you can implement your database operations.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for more details.