Code Monkey home page Code Monkey logo

docker-compose-challengev2's Introduction

Docker Challenge PostGres

In this workshop we're going to look at how to use express with a postgres database.

Learning Objectives

  • Startup PostGres Database as Container
  • Create Docker Image with current Repo docker-challenge-postgres
  • Run Image for docker-challenge-postgres as a container
  • Make API call to Create, Retrieve all books etc.

Setup

  1. Fork this repository docker-challenge-postgres
  2. Clone the forked repository onto your local machines
  3. In the root directory, type npm install, which installs dependencies for the project
  4. Pull docker Image for PostGres docker pull postgres.
  5. Run docker init.
  6. Run and Connect to your PostGres Container. Using a docker compose file.

** Remember to setup the volume in docker compose file for the PostGres Service.**

  1. Open a port to enable your connection to the PostGres container.
  2. Run the following database scripts
  • create-books.sql
  • insert-books.sql
  1. Update a file .env in the root directory of your project with you PostGres Container details.
  2. Type npm start, which starts a development server that will reload whenever you make any changes to source files.
  3. Build docker image for current repo docker-challenge-postgres
  4. Run Docker image for docker-challenge-postgres part of the docker-compose docker-compose up

Conclusion

Create a PR to point to current repo with you changes and docker files. Dockerfile, Docker-compose etc.

  • In the PR upload a screenshot of your docker desktop where containers are running.
  • In the PR upload a screenshot of your response when retrieving a list of books. From the container.

docker-compose-challengev2's People

Contributors

allendewilzin avatar peachyomnivore avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.