Skip to content

Commit

Permalink
added new docker compose file for gitops
Browse files Browse the repository at this point in the history
  • Loading branch information
EvilGenius13 committed Sep 25, 2023
1 parent 7f03d79 commit ec846d3
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM python:3.8-slim-buster
# Set the working directory in the container
WORKDIR /app

# Install netcat for our startup script - doesn't come with slim-buster
# Install netcat for our startup script - doesn't come with slim-buster (needed for the startup script)
RUN apt-get update && apt-get install -y netcat && rm -rf /var/lib/apt/lists/*

# Copy the requirements file
Expand Down
45 changes: 45 additions & 0 deletions dc-ops.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: '3'

volumes:
postgres_data:
driver: local

services:
postgres:
image: postgres:latest
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: Ash
POSTGRES_PASSWORD: Ketchum
POSTGRES_DB: pokeappdb
healthcheck:
test: ["CMD-SHELL", "pg_isready -U Ash"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s

redis:
image: redis:latest
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s

pokeapp:
build: .
ports:
- "5000:5000"
environment:
SECRET_KEY: pokemon
DATABASE_URL: postgresql://Ash:Ketchum@postgres:5432/pokeappdb
REDIS_URL: redis://redis:6379/0
depends_on:
- postgres
- redis
command: /app/start-pokeapp.sh # Script command to watch for postgres and redis to be ready before starting the app
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ services:
depends_on:
- postgres
- redis
command: /app/start-pokeapp.sh # Update the command to use your start script
command: /app/start-pokeapp.sh # Script command to watch for postgres and redis to be ready before starting the app

0 comments on commit ec846d3

Please sign in to comment.