Skip to content

Commit

Permalink
🔥 Update docker compose and Dockerfile (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
khanh41 authored Oct 30, 2023
1 parent e01da5d commit 8918a87
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 24 deletions.
21 changes: 0 additions & 21 deletions Dockerfile

This file was deleted.

6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
version: "3"
version: "3.9"

services:
app:
build: .
build:
context: "{{cookiecutter.project_slug}}"
dockerfile: "docker/Dockerfile"
restart: on-failure
depends_on:
- mongodb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UserSchema(CustomBaseModel):

class Config:
"""Config."""
schema_extra = {
json_schema_extra = {
"example": {
"username": "example@gmail.com",
"password": "abcd123456",
Expand Down
12 changes: 12 additions & 0 deletions {{cookiecutter.project_slug}}/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: "3.9"

services:
backend-app:
container_name: {{cookiecutter.project_slug}}-backend-app
build:
context: .
dockerfile: docker/Dockerfile
Expand All @@ -10,14 +11,25 @@ services:
- mongodb
ports:
- "{{cookiecutter.port}}:{{cookiecutter.port}}"
healthcheck:
test: [ "CMD-SHELL", "curl http://0.0.0.0:{{cookiecutter.port}}/" ]
interval: 60s
timeout: 5s
retries: 5
networks:
- backend-network

mongodb:
image: mongo
container_name: {{cookiecutter.project_slug}}-mongodb
ports:
- "27017:27017"
restart: always
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
env_file:
- .env
volumes:
Expand Down

0 comments on commit 8918a87

Please sign in to comment.