How to configure a connection string correctly for mssql database running on docker-compose?

Advertisements I’m running a .NET app and trying to dockerize it. My docker compose is as follows: version: ‘3.4’ services: mssql: container_name: mtg-mssql-db hostname: mssql-db image: mcr.microsoft.com/mssql/server:2022-latest environment: ACCEPT_EULA: ‘Y’ MSSQL_SA_PASSWORD: ‘Admin@123’ MSSQL_DATA_DIR: /var/opt/mssql/data MSSQL_PID: ‘Developer’ MSSQL_TCP_PORT: 1433 ports: – "1455:1433" volumes: – ./data:/var/opt/mssql/data – ./log:/var/opt/mssql/log – ./secrets:/var/opt/mssql/secrets mtgmvc: image: ${DOCKER_REGISTRY-}mtgmvc build: context: . dockerfile:… Read More How to configure a connection string correctly for mssql database running on docker-compose?

Why CMD is not executed through neither the docker create nor docker start command?

Advertisements Consider the following Dockerfile being simple FROM ubuntu RUN apt update && apt install neofetch -y CMD ["echo", "Hello From Docker to Ubuntu"] According with some research the RUN instruction is executed only when the image is build through the docker build command and the CMD instruction is executed when the container is created… Read More Why CMD is not executed through neither the docker create nor docker start command?

Java LocalTime.parse working in spring boot on local PC but not working in Docker container

Advertisements Title describes my problem. I’m feeling really dumb now because it’s probably a minor, tiny issue. I’ve been stuck on this for almost 2 days. The app I’m building is much bigger, with docker compose to start the postgres container, but the problem can be recreated by creating a new (java 21, maven) spring… Read More Java LocalTime.parse working in spring boot on local PC but not working in Docker container

/bin/sh: 1: react-scripts: not found in development ENV reactjs

Advertisements I want to use Docker in development mode, This is my Docker file. FROM node:18.12.1 WORKDIR /usr/src/app COPY package*.json ./ RUN yarn install COPY . . EXPOSE 3000 CMD ["yarn", "start"] and my docker-compose is: version: ‘3’ services: mlm_frontend: build: context: . dockerfile: Dockerfile.dev volumes: – ./:/usr/src/app ports: – "3000:80" I have an error… Read More /bin/sh: 1: react-scripts: not found in development ENV reactjs

Flask REST API 404 Error When Trying to Access Endpoint

Advertisements I am currently working on a Flask REST API that interacts with a Dockerized MySQL database. I have encountered a 404 error when trying to access the /api/create_account endpoint using cURL. Strangely, the index to ‘/’ endpoint seems to be working fine Endpoint: /api/create_account cURL Request: curl –location ‘http://localhost:5000/api/create_account’ \ –header ‘Content-Type: application/json’ \… Read More Flask REST API 404 Error When Trying to Access Endpoint

DJango and Docker: db shutting down and web service not accepting connections

Advertisements I have a problem with Docker. I am trying to build a docker postgres DB and web service for a DJango app. Here is my config: Dockerfile: # syntax=docker/dockerfile:1 FROM python:3 ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 WORKDIR /code COPY requirements.txt /code/ RUN pip install -r requirements.txt COPY . /code/ docker-compose.yml: services: db: image: postgres volumes:… Read More DJango and Docker: db shutting down and web service not accepting connections

Cannot reach Spring boot application in Docker

Advertisements I have a Eureka Discovery Service build with Spring Boot 3. I created Dockerfile file with following content: FROM mcr.microsoft.com/openjdk/jdk:17-ubuntu RUN addgroup –system spring RUN adduser –system spring USER spring:spring ARG JAR_FILE=target/*.jar COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-jar","/app.jar"] EXPOSE 8880:8880 When I do docker ps I could see the app: $ docker ps CONTAINER ID… Read More Cannot reach Spring boot application in Docker

Unable to connect to Postgres Docker Conatiner From Application Server

Advertisements I have a postgres image running my database and I run this as a Docker container and I can connect to it from psql, but when I connect to it from my application server, I get the following error: org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that… Read More Unable to connect to Postgres Docker Conatiner From Application Server