To use MongoDB in Azure App Service through Docker-Compose, follow these steps:
version: "3.8"
services:
app:
build: .
ports:
- "3000:3000"
depends_on:
- db
environment:
- MONGODB_URI=mongodb://db:27017/mydatabase
db:
image: mongo:latest
restart: always
volumes:
- db_data:/data/db
volumes:
db_data:
Replace the "mydatabase" with the name of your database that you want to connect to.
Create a new Azure App Service instance and configure it to use Docker-Compose for deployment.
Deploy your application to Azure App Service by uploading your Docker-Compose file.
Verify that your application is running by checking the logs of your Azure App Service instance.
Connect to MongoDB by using the MONGODB_URI environment variable that you defined in your Docker-Compose file.
Now you can use MongoDB in Azure App Service through Docker-Compose.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-05-06 09:08:46 +0000
Seen: 14 times
Last updated: May 06 '23
What is the process of integrating API data into MongoDB using Spark/Python?
How can additional fields that have been transformed be queried in MongoDB?
What is the difference between indexing in Elasticsearch and MongoDB?
When data is updated in MongoDB, why does Logstash not reflect the changes?
How can the Mongo Operator be used to deploy MongoDB in EKS/EFS?
How can data be extracted from Azure DocumentDB for exporting purposes?
How can I link or integrate mongodb with Google Data Studio?