Replies: 3 comments 2 replies
-
Hi I am trying to load the demo data from https://surrealdb.com/docs/surrealql/demo [~]$ docker exec -i surrealdb /surreal import --conn http://localhost:8000 --user root --pass root --ns test --db test surreal_deal_v1.surql Can you please advise how I can import the data? |
Beta Was this translation helpful? Give feedback.
-
One approach you could follow is to have a second compose container that checks if the SurrealDB server has no data, and if so, load the surql file from there. If you do that, you can build a custom Docker image with a shell for that 2nd container. Soon we plan to provide more Docker images to support more use cases (with shell, with FoundationDB support, etc). |
Beta Was this translation helpful? Give feedback.
-
Hi, I've been looking to do something similar, to be able to create a docker image that already contains a database inside. Do you know if it's possible now? |
Beta Was this translation helpful? Give feedback.
-
hello !
I have a surrealdb in a docker compose project, a schema.surql. I would like that at the first start of the container, the schema is imported automatically.
Is there a better way to do this than something like that : ```sh
#!/bin/bash
set -e
INIT_FLAG="/db/imported-schema"
if [ ! -f "$INIT_FLAG" ]; then
/surreal start --log debug &
PID=$!
fi
exec "$@"
Beta Was this translation helpful? Give feedback.
All reactions