Skip to content

Commit

Permalink
🚀 update docker services to be compatible with kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
agn-7 committed Sep 14, 2023
1 parent b1a1527 commit 6bdc202
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions bitpin/bitpin/product_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"NAME": "bitpin_db",
"USER": "bitpin_usr",
"PASSWORD": "root",
"HOST": "bitpin_db",
"PORT": "",
"HOST": "bitpin-db-service",
"PORT": "5432",
"TEST": {
"NAME": "bitpin_test_db",
},
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ services:
- "./bitpin/static:/code/static:ro"
- "./nginx/nginx.conf:/etc/nginx/conf.d/nginx.conf:ro"
depends_on:
- bitpin_app
- bitpin-app-service
logging:
driver: "json-file"
options:
max-size: "50m"

bitpin_db:
bitpin-db-service:
image: postgres:11-alpine
restart: unless-stopped
expose:
Expand All @@ -36,7 +36,7 @@ services:
options:
max-size: "50m"

bitpin_app:
bitpin-app-service:
build: .
image: bitpin:1.0.0
container_name: bitpin_app
Expand All @@ -52,7 +52,7 @@ services:
- "80"
- "8000"
depends_on:
- bitpin_db
- bitpin-db-service
logging:
driver: "json-file"
options:
Expand All @@ -63,7 +63,7 @@ services:
hostname: pgadmin
image: dpage/pgadmin4
depends_on:
- bitpin_db
- bitpin-db-service
environment:
PGADMIN_DEFAULT_EMAIL: admin@ava.com
PGADMIN_DEFAULT_PASSWORD: admin
Expand Down
2 changes: 1 addition & 1 deletion k8s/deployment/bitpin-app-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
containers:
- name: bitpin-app
image: localhost:5000/bitpin:1.0.0
imagePullPolicy: IfNotPresent
imagePullPolicy: IfNotPresent # for development change it to Always
command: ["bash", "start.sh"]
ports:
- containerPort: 8000
Expand Down
2 changes: 1 addition & 1 deletion k8s/service/bitpin-app-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ spec:
app: bitpin-app
ports:
- name: http
port: 80
port: 8000
targetPort: 8000
type: ClusterIP
2 changes: 1 addition & 1 deletion nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
upstream bitpin {
server bitpin_app:8000;
server bitpin-app-service:8000;
}

limit_req_zone $binary_remote_addr zone=one:10m rate=50r/s;
Expand Down

0 comments on commit 6bdc202

Please sign in to comment.