Docker compose error while creating mount source path

It’s likely a pathing issue with Docker when installed with snap, you’re better off installing it with the official documentation from Docker. Remove docker from snap snap remove docker Remove the docker directory, and old version (It’s okay if these don’t exist already) rm -R /var/lib/docker sudo apt-get remove docker docker-engine docker.io Install the official … Read more

Using current user when running container in docker-compose

Building on top of the answer by Joepreludian, focusing on docker-compose: You can use the user: and volumes: options in the compose file. For example: my-service: image: ubuntu:latest user: ${MY_UID}:${MY_GID} volumes: – /etc/passwd:/etc/passwd:ro – /etc/group:/etc/group:ro and define these variables where you are starting your compose: MY_UID=”$(id -u)” MY_GID=”$(id -g)” docker-compose up

Adding python logging to FastApi endpoints, hosted on docker doesn’t display API Endpoints logs

Inspired by JPG’s answer, but using a pydantic model looked cleaner. You might want to expose more variables. This config worked good for me. from pydantic import BaseModel class LogConfig(BaseModel): “””Logging configuration to be set for the server””” LOGGER_NAME: str = “mycoolapp” LOG_FORMAT: str = “%(levelprefix)s | %(asctime)s | %(message)s” LOG_LEVEL: str = “DEBUG” # … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)