Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sample docker-compose file
# Use postgres/example user/password credentials
version: '3.1'
networks:
myapp-network:
services:
#https://hub.docker.com/_/postgres/
myapp-db:
image: postgres:latest
container_name: myapp-db
env_file:
- ../../Docker/myapp/environmentvariables-db.env
ports:
- "5433:5432"
expose:
- "5432" # signifies intent to expose the port for inter-docker container comms
networks:
- myapp-network
myapp-server:
image: dockerhubusername/reponame:version
container_name: myapp-server
ports:
- "8080:8080"
- "8000:8000"
depends_on:
- myapp-db
links:
- myapp-db
expose:
- "8080"
- "8000"
volumes:
- ../../Docker/myapp/logs/:/usr/local/tomcat/logs
- ../../Docker/myapp/downloads/webpages:/usr/local/tomcat/downloads/webpages
env_file:
- ../../Docker/myapp/environmentvariables-server.env
environment:
- CATALINA_HOME=/usr/local/tomcat
- SPRING_PROFILES_ACTIVE=postgresql
networks:
- restaurantscores-network
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.