Last active
July 18, 2024 18:55
-
-
Save FernandoCutire/f441ee224d526dd143ecef386a3c9e68 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Docker Compose file Reference (https://docs.docker.com/compose/compose-file/) | |
version: '3' | |
# Define services | |
services: | |
# App Service | |
app: | |
# Configuration for building the docker image for the service | |
build: | |
context: . # Use an image built from the specified dockerfile in the current directory. | |
dockerfile: Dockerfile | |
ports: | |
- "8080:8080" # Forward the exposed port 8080 on the container to port 8080 on the host machine | |
restart: unless-stopped | |
depends_on: | |
- redis # This service depends on redis. Start that first. | |
environment: # Pass environment variables to the service | |
REDIS_HOST: redis | |
REDIS_PORT: 6379 | |
networks: # Networks to join (Services on the same network can communicate with each other using their name) | |
- backend | |
# Redis Service | |
redis: | |
image: "redis:alpine" # Use a public Redis image to build the redis service | |
restart: unless-stopped | |
networks: | |
- backend | |
networks: | |
backend: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment