Octopus docker compose Persistence

I’ve been trying to setup Octopus Deploy in a container, which I got working with the GitHub repo and following the documentation out there and also a bit here (which conflicts btw): https://octopus.com/docs/installation/octopus-in-container/docker-compose.

Anyway, is there any way we can persists the data? I am guessing everything is stored in the database image I am using (image: microsoft/mssql-server-windows-express), which doesn’t seem to persist the db to the host via volume mounts.

I did come across an article here: https://www.richard-banks.org/2017/03/connecting-to-sql-on-docker.html, which sounds like something I can try but will this work for Octopus Deploy?

-e attach_dbs="[{‘dbName’:‘MyDb’,‘dbFiles’:[‘C:\temp\mydb.mdf’,‘C:\temp\mydb_log. ldf’]}]"

Thanks

Hi @nmajin,
There are conflicting opinions about whether databases make sense to be run inside containers. I would probable side with not including the database inside a container for simplicity (which is why those docs say “For evaluation purposes”), however if you are keen to do so, then I would say that the blog post you have found is correct. You will need to mount a directory to the docker filesystem in order to persist the database files. Will it work with Octopus Deploy? I can’t see why not. The fun of containers is that it should be pretty easy to spin one up and test :slight_smile:
Keep in mind that you will also need to mount the other image volume mount points on the Octopus Server image to ensure that everything is available for when you plan on spinning up a new Octopus Server container.
Let me know how your configuration goes or if you run into any further difficulty.
Cheers,
Rob