mockoon / mockoon

Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
https://mockoon.com
Other
6.54k stars 389 forks source link

Dockerized instance still doesn't log to file #1527

Closed timthedevguy closed 1 month ago

timthedevguy commented 1 month ago

Created a custom Dockerfile using 'dockerize' command. Removed the '--disable-log-to-file' from the ENTRYPOINT command. Created an image and host it on my Azure Container Registry. /home/mockoon/.mockoon-cli/logs remains empty even after several requests are made, I can see the requests are coming in via the stdout.

FROM node:18-alpine

RUN npm install -g @mockoon/cli@8.4.0

# Install curl for healthcheck and tzdata for timezone support.
RUN apk --no-cache add curl tzdata

# Do not run as root.
RUN adduser --shell /bin/sh --disabled-password --gecos "" mockoon
USER mockoon

EXPOSE 3033

ENTRYPOINT ["mockoon-cli","start","--log-transaction", "--data","https://raw.githubusercontent.com/timthedevguy/mock.api/refs/heads/main/endpoints.json","--port","3033"]

Mockoon version:

@mockoon/cli@8.4.0

OS / OS version:

Container running on Rancher OS

timthedevguy commented 1 month ago

While technically this is an issue, it is no longer an issue for me, turns out I can retrieve the logs I need from the admin endpoint.

255kb commented 1 month ago

Glad you found a workaround.

I couldn't reproduce your issue with my local Docker. I can correctly see the logs in the /home/mockoon/.mockoon-cli/{env_name}.log file: image

Maybe it's an Azure limitation?

timthedevguy commented 1 month ago

Interesting, the running container is just on a DigitalOcean Docker box, not azure, azure is just where I have some credits to use and made a container registry. But thanks for trying it, at least I know it should work.

255kb commented 1 month ago

ok, thanks for the precision. I won't reopen the issue, but if I see more activity here, I will definitely investigate more.