I've looped back around to this, and I am trying to use the official container and modifying it to work with Google Cloud Run, which has similar rules as Cloud Function, such as needing to make disk changes in the /tmp/ folder.
Here is my current dockerfile:
FROM jsreport/jsreport:4.8.0-full
# Create directory with proper permissions
RUN mkdir -p /tmp/data/storage && \
chown -R jsreport:jsreport /tmp/data && \
chmod -R 755 /tmp/data
# Copy only the template data and configuration files
COPY ./reporting/data /tmp/data
COPY ./reporting/cloudrun.config.json /app/jsreport.config.json
# For Google Cloud Run - use the PORT environment variable
ENV PORT=8080
ENV httpPort=8080
EXPOSE 8080
Here is the current custom-config file:
{
"httpPort": 5488,
"trustUserCode": true,
"store": {
"provider": "fs"
},
"blobStorage": {
"provider": "fs",
"dataDirectory": "/tmp/storage"
},
"reportTimeout": 60000,
"logger": {
"file": {
"silent": true
},
"error": {
"silent": true
}
},
"extensions": {
"licensing": {
"useSavedLicenseInfo": false
},
"authentication": {
"enabled": false
},
"authorization": {
"enabled": false
},
"cli": {
"enabled": false
},
"express": {
"enabled": true
},
"freeze": {
"enabled": false
},
"fs-store": {
"dataDirectory": "/tmp/data"
},
"import-export": {
"enabled": false
},
"public-templates": {
"enabled": false
},
"sample-template": {
"enabled": false
},
"scheduling": {
"enabled": false
},
"studio": {
"enabled": true
},
"studio-theme-dark": {
"enabled": false
},
"tags": {
"enabled": false
},
"version-control": {
"enabled": false
},
"base": { "enabled": false },
"child-templates": { "enabled": false },
"components": { "enabled": true },
"data": { "enabled": true },
"handlebars": { "enabled": true },
"jsrender": { "enabled": false },
"localization": { "enabled": false },
"npm": { "enabled": false },
"pdf-utils": { "enabled": false },
"reports": { "enabled": false },
"text": { "enabled": false },
"assets": { "enabled": true },
"browser-client": { "enabled": false },
"chrome-pdf": { "enabled": true },
"docx": { "enabled": false },
"html-to-xlsx": { "enabled": false },
"pptx": { "enabled": false },
"scripts": { "enabled": false },
"static-pdf": { "enabled": false },
"xlsx": { "enabled": false }
},
"chrome": {
"launchOptions": {
"args": ["--no-sandbox"]
}
}
}
However, on start up, even locally, I get:
2025-04-17T12:50:34.714Z - info: fs store is loading data
2025-04-17T12:50:34.716680854Z 2025-04-17T12:50:34.716Z - error: Error occurred during reporter init: Error: EACCES: permission denied, open '/tmp/data/storage/config.json'
2025-04-17T12:50:34.717906560Z [Error: EACCES: permission denied, open '/tmp/data/storage/config.json'] {
2025-04-17T12:50:34.717925837Z errno: -13,
2025-04-17T12:50:34.717929404Z code: 'EACCES',
2025-04-17T12:50:34.717932209Z syscall: 'open',
2025-04-17T12:50:34.717934734Z path: '/tmp/data/storage/config.json'
2025-04-17T12:50:34.717937309Z }
Do you have any suggestions on how to overcome this issue? I don't suspect that config.json file is there at all, it isn't when I copy the data folder.