-
Hi team, thank you for an interesting FOSS product. I have a simple web-app that has three components:
Config as follows: {
"listeners": {
"*:80": {
"pass": "routes"
}
},
"routes": [
{
"match": {
"uri": ["/api*"]
},
"action": {
"pass": "applications/fastapi"
}
},
{
"match": {
"uri": "/*"
},
"action": {
"share": "/www/static$uri"
}
}
],
"applications": {
"fastapi": {
"type": "python 3.12",
"path": "/var/app",
"module": "myapp.api",
"callable": "app"
},
"worker": {
"type": "python 3.12",
"path": "/var/app",
"module": "myapp.tasks",
"callable": "run_celery_worker"
}
},
"access_log": "/dev/stdout"
}
Dockerfile like this: FROM node:22 AS build
WORKDIR /var/app
COPY . .
RUN npm run build
FROM unit:python3.12
WORKDIR /var/app
COPY --from=build /var/app/dist /www/static
RUN chown -R unit:unit .
COPY unit.config.json /docker-entrypoint.d/
COPY myapp .
COPY requirements.txt requirements.txt
COPY myapp myapp
RUN pip install -r requirements.txt
EXPOSE 8000 I can access the backend and frontend just fine in the browser, so the unit config seems to be correct. Both the backend and the worker app is logging to the console, but when I run the application in unit, these logs are not seen anywhere. I do, however, see the unit access logs, but I would like to be able to also see the logs from my applications. Can this be achieved? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Perhaps by setting the applications |
Beta Was this translation helpful? Give feedback.
-
I ended up ditching unit and deploying my backend and celery worker in a separate container, with an nginx container as a proxy in front. I do think the idea of unit is nice though, so would still like to understand a bit more whether my use of it in this example was somehow not aligned with the intended use-case. |
Beta Was this translation helpful? Give feedback.
I ended up ditching unit and deploying my backend and celery worker in a separate container, with an nginx container as a proxy in front. I do think the idea of unit is nice though, so would still like to understand a bit more whether my use of it in this example was somehow not aligned with the intended use-case.