Update compose.yaml
Browse files- compose.yaml +84 -49
compose.yaml
CHANGED
|
@@ -1,49 +1,84 @@
|
|
| 1 |
-
# Comments are provided throughout this file to help you get started.
|
| 2 |
-
# If you need more help, visit the Docker Compose reference guide at
|
| 3 |
-
# https://docs.docker.com/go/compose-spec-reference/
|
| 4 |
-
|
| 5 |
-
# Here the instructions define your application as a service called "server".
|
| 6 |
-
# This service is built from the Dockerfile in the current directory.
|
| 7 |
-
# You can add other services your application may depend on here, such as a
|
| 8 |
-
# database or a cache. For examples, see the Awesome Compose repository:
|
| 9 |
-
# https://github.com/docker/awesome-compose
|
| 10 |
-
services:
|
| 11 |
-
server:
|
| 12 |
-
build:
|
| 13 |
-
context: .
|
| 14 |
-
ports:
|
| 15 |
-
- 8000:8000
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Comments are provided throughout this file to help you get started.
|
| 2 |
+
# If you need more help, visit the Docker Compose reference guide at
|
| 3 |
+
# https://docs.docker.com/go/compose-spec-reference/
|
| 4 |
+
|
| 5 |
+
# Here the instructions define your application as a service called "server".
|
| 6 |
+
# This service is built from the Dockerfile in the current directory.
|
| 7 |
+
# You can add other services your application may depend on here, such as a
|
| 8 |
+
# database or a cache. For examples, see the Awesome Compose repository:
|
| 9 |
+
# https://github.com/docker/awesome-compose
|
| 10 |
+
#services:
|
| 11 |
+
# server:
|
| 12 |
+
# build:
|
| 13 |
+
# context: .
|
| 14 |
+
# ports:
|
| 15 |
+
# - 8000:8000
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
version: '3.8'
|
| 19 |
+
|
| 20 |
+
services:
|
| 21 |
+
mongodb:
|
| 22 |
+
image: mongo:6.0
|
| 23 |
+
ports:
|
| 24 |
+
- "27017:27017"
|
| 25 |
+
environment:
|
| 26 |
+
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME}
|
| 27 |
+
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
|
| 28 |
+
healthcheck:
|
| 29 |
+
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
| 30 |
+
interval: 5s
|
| 31 |
+
timeout: 3s
|
| 32 |
+
retries: 5
|
| 33 |
+
volumes:
|
| 34 |
+
- mongodb_data:/data/db
|
| 35 |
+
|
| 36 |
+
app:
|
| 37 |
+
image: your-app-image:latest
|
| 38 |
+
env_file:
|
| 39 |
+
- .env
|
| 40 |
+
depends_on:
|
| 41 |
+
mongodb:
|
| 42 |
+
condition: service_healthy
|
| 43 |
+
ports:
|
| 44 |
+
- "3000:3000"
|
| 45 |
+
environment:
|
| 46 |
+
- MONGO_URI=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongodb:27017/
|
| 47 |
+
- MONGO_DB_NAME=${MONGO_DB_NAME}
|
| 48 |
+
|
| 49 |
+
volumes:
|
| 50 |
+
mongodb_data:
|
| 51 |
+
|
| 52 |
+
# The commented out section below is an example of how to define a PostgreSQL
|
| 53 |
+
# database that your application can use. `depends_on` tells Docker Compose to
|
| 54 |
+
# start the database before your application. The `db-data` volume persists the
|
| 55 |
+
# database data between container restarts. The `db-password` secret is used
|
| 56 |
+
# to set the database password. You must create `db/password.txt` and add
|
| 57 |
+
# a password of your choosing to it before running `docker compose up`.
|
| 58 |
+
# depends_on:
|
| 59 |
+
# db:
|
| 60 |
+
# condition: service_healthy
|
| 61 |
+
# db:
|
| 62 |
+
# image: postgres
|
| 63 |
+
# restart: always
|
| 64 |
+
# user: postgres
|
| 65 |
+
# secrets:
|
| 66 |
+
# - db-password
|
| 67 |
+
# volumes:
|
| 68 |
+
# - db-data:/var/lib/postgresql/data
|
| 69 |
+
# environment:
|
| 70 |
+
# - POSTGRES_DB=example
|
| 71 |
+
# - POSTGRES_PASSWORD_FILE=/run/secrets/db-password
|
| 72 |
+
# expose:
|
| 73 |
+
# - 5432
|
| 74 |
+
# healthcheck:
|
| 75 |
+
# test: [ "CMD", "pg_isready" ]
|
| 76 |
+
# interval: 10s
|
| 77 |
+
# timeout: 5s
|
| 78 |
+
# retries: 5
|
| 79 |
+
# volumes:
|
| 80 |
+
# db-data:
|
| 81 |
+
# secrets:
|
| 82 |
+
# db-password:
|
| 83 |
+
# file: db/password.txt
|
| 84 |
+
|