Intermediate Docker
Mike Metzger
Data Engineering Consultant
services:
postgres:
container_name: postgres
image: postgres:latest
ports:
- "5432:5432"
restart: always
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4:latest
ports:
- "5050:80"
restart: always
services: list the containers to loadnetworks: handles networking definitionsvolumes: controls any volume mountingconfigs: handles configuration options without custom imagessecrets: Provides options to handle passwords, tokens, API keys, etcservices: ... # Define containersnetworks: ... # Define any networking detailsvolumes: ... # Define storage requirementsconfigs: ... # Define special config detailssecrets: ... # Define passwords / etc
services:# Resource name postgres:# Container name, otherwise random container_name: postgres# Container image to use image: postgres:latest# Any port mapping required ports: # Network details - "5432:5432"# Next resource pgadmin: ...
container_name:, the assigned name of the container otherwise it's randomimage:, which container image to useports:, contains a list of any port mapping requiredconfig.yaml syntax is extensivecompose.yaml optionscompose.yaml file from scratchIntermediate Docker