All Templates / Storage
MongoDB
Mongo database with data persistence and TCP Proxy
MongoDB
mongo
Just deployed
/data/db
Mongo database deployed with the official Docker image.
A volume is mounted to the service to persist data between builds.
TCP proxying is configured to allow accessing the database from anywhere.
The Mongo container deployed from this template is started with the following command, to enable communication over IPv6 (required for Private Networking): docker-entrypoint.sh mongod --ipv6 --bind_ip ::,0.0.0.0
Reference the MONGO_URL
variable from your service to connect to the database in your tool of choice (e.g. ${{Mongo.MONGO_URL}}
)
Connect to the database using the proxied domain and port found on the service Settings page. The password can be found on the Variables page.
In a terminal, for example:
mongo mongodb://mongo:PASSWORD@TCP_PROXY_DOMAIN:TCP_PROXY_PORT
Template Content
MongoDB
mongoDetails
Railway Templates
Created on Sep 9, 2023
5266 total projects
3148 active projects
Storage
More templates in this category