feat: add Dockerfile and docker-compose.yml for containerized application setup#334
feat: add Dockerfile and docker-compose.yml for containerized application setup#334
Conversation
… steps for macOS, Windows, and Linux, and commands for running, checking, and managing the Docker container.
|
@JessUWE just tested this by:
This all worked, BUT after selecting either researcher or output checker I then get the version which opens some data directly already - I.e does not allow me to chose what directory ot open. Question 1 this the desired behaviour ? I.e. is it a container thing and the folder has to be specified and mapped in the Dockerfile? If so, then the researcher option doesn't make sense:
Question 2: Maybe we need to be clear about the use-case? I.e. maybe having it run in a docker container only makes sense for output checking? |
@jim-smith It’s not clear what you mean by “next step didn’t work” for step 2. Is your Docker status showing as running? I’m not seeing these issues on my end. Also, just to clarify- on the current branch, the SACRO Viewer feature for the folder picker hasn’t been merged yet. As we agreed previously, this should be fully tested before opening a PR. When you ran it and checked your docker application did it show something like the below;
Question 1: Yes, this is expected Docker behaviour. The data is baked into the container at build time (via COPY data ./data in the Dockerfile), so there's no folder picker in the Docker version, that's a feature on a different branch. The Docker version is intentionally pre-loaded with the sample data Question 2: The researcher workflow (adding, renaming, deleting files) does work, we've verified this on our end. The errors you're seeing are likely because the sample outputs.json got corrupted during your session which has nothing to do with docker. Could you try:
|
Hi @JessUWE will test this later. |
@jim-smith /data was mounted as read-only, which prevented writes. I have changed that to r/w. However, the ./outputs volume in the docker-compose.yml is already read-write and bind-mounted to the host, so any approved output zips generated by the "Approve and Download" action get written directly to the ./outputs folder on the host in real time. |
Page not found (404)Request Method: | POST -- | -- http://localhost:8000/review/current/approved-outputs/ sacro.views.approved_outputsUsing the URLconf defined in
The current path, You’re seeing this error because you have |
|
@JessUWE happy to approve this if you will create a separate issue for the unsupported items in the drop-down menu for 'output type' in researcher mode I wonder if we need to be more explicit (in developers.md and/or somewhere else) that the directory containing the main 'session' needs to be called outputs because it is hard mapped by the docker? |
| ``` | ||
|
|
||
| ### Troubleshooting | ||
|
|
There was a problem hiding this comment.
Maybe this is where we say "not seeing the data/outpuyts you expect? - they need to be in directory called outputs' in the same folder that the docker image is created from
There was a problem hiding this comment.
Happy to approve but where do we tell people the the session results have to be in a folder called outputs, and does it need ot be there when the docker is created? or can that mapping be done later at run-time?
ps: these re usability things not tech things.
@jim-smith can please you clarify what you mean by unsupported? at the minute everything in the dropdown works, are you getting an error? if yes could you elaborate on what you are getting? |




Summary
This PR introduces Docker containerization support to the SACRO-Viewer project, enabling consistent development and production environments.
Files Changed
.dockerignore- Added/updated to exclude unnecessary files like node_modules, git files, and test artifacts from the Docker build, keeping the image smaller and builds faster.Dockerfile- Created a new multi-stage Docker setup. The first stage uses Node.js to build frontend assets (Vite, Tailwind, PostCSS). The second stage uses Python to run the Django app with Uvicorn.docker-compose.yml- Created a new service configuration that maps port 8000, mounts volumes for data and outputs, loads environment from .env, and includes health checks to monitor the app.Impact
docker-composeHow to test
docker-compose up --build