Skip to content

Commit

Permalink
added docker swarm config
Browse files Browse the repository at this point in the history
  • Loading branch information
EvilGenius13 committed Sep 30, 2023
1 parent f0f04a2 commit f53c55a
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

## Filling the Database
- To fill the database:
- Go to base.html
- Click the button that says "Fill Database"
- Please note it will take a bit to complete. When it's done you'll get a message saying data filled.

Expand All @@ -21,3 +20,7 @@
- `docker-compose build`
- `docker-compose up`

## And DevOps!
- If you have portainer or another docker management system that allows you to use github repos, you can point to this repo and use `dc-ops.yml` to deploy the app.
### Thank you
- Thank you to @digitsgaming for the continual support with server infrastructure and deployment.
2 changes: 1 addition & 1 deletion dc-ops.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: '3' # This is a deployment config for portainer. It pulls from the github repo.

volumes:
postgres_data:
Expand Down
54 changes: 54 additions & 0 deletions dc-swarm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: '3.8' # Newer Docker Compose version. This is a deployment config for portainer with docker swarm. It pulls from the github repo.

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:
- target: 6379
published: 6379
protocol: tcp
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s

pokeapp:
build: .
ports:
- target: 5000
published: 5000
protocol: tcp
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
deploy:
replicas: 3
update_config:
parallelism: 1
delay: 10s

0 comments on commit f53c55a

Please sign in to comment.