Skip to Content
Mastering Functional Programming
book

Mastering Functional Programming

by Anatolii Kmetiuk
August 2018
Intermediate to advanced
380 pages
10h 2m
English
Packt Publishing
Content preview from Mastering Functional Programming

Dockerfiles

Dockerfiles contain the descriptions of how a particular image must be built. We have two images: one is for the database, and the other one is for the backend. Let's start with the database image first:

FROM postgres:latestADD ./*.sql /docker-entrypoint-initdb.d/

The Docker file only contains two lines of code. First of all, we inherit from an existing image of Postgres. Second, we copy all of the SQL files from the current directory to a special directory in the Docker image. This is a standard initialization procedure described in the documentation of the Postgres image we inherit from. The main idea is to initialize the database with a schema that we are going to use. Our schema is as follows:

CREATE TABLE customer ( id serial ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Functional Programming

Learning Functional Programming

Jack Widman

Publisher Resources

ISBN: 9781788620796Supplemental Content