Keyvan
Keyvan
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
Thanks for the effort
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
The problem was that in docker i cant use localhost(127.0.0.0) i switched to 0.0.0.0 and now its working
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
I got it to work!!! @everyone
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
So if it is any mapping or CORS i should get an error
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
hmmm, then i suspect port mapping as the problem. I will try to send http rq to the backend from the frontend. They are in the same container in development
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
So the code works fine, the backend is launched and runnung but i cannot send requests to the backend from outside of the container...
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
i can send curl request from within the docker shell but not form outside of the docker shell
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
yeah The thing is:
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
yes it does because of the volume mounting in the docker compose
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
.
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
which executes a shell script dotnet run
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
Yes but in the docker compose there is defined entrypoint
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
Also i run dotnet run in entrypoint.sh
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
Not prod
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
Its a development dockerfile
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
Here is my docker file:
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build

WORKDIR /app

COPY *.csproj /app
RUN dotnet restore

EXPOSE 5001
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build

WORKDIR /app

COPY *.csproj /app
RUN dotnet restore

EXPOSE 5001
Here is my docker compose file:
version: '3'

services:
frontend:
build:
context: ./client
dockerfile: Dockerfile
volumes:
- ./client/:/app/
- ./scripts/client/:/scripts/
ports:
- "3000:3000"
entrypoint:
- /scripts/entrypoint.sh
environment:
- CHOKIDAR_USEPOLLING=True # Enable polling for file changes
- WATCHPACK_POLLING=True
- NODE_ENV=development

backend:
build:
context: ./server
dockerfile: Dockerfile
volumes:
- ./server/:/app/
- ./scripts/server/:/scripts/
ports:
- "5001:5001"
entrypoint:
- /scripts/entrypoint.sh
env_file:
- ./server/.env
version: '3'

services:
frontend:
build:
context: ./client
dockerfile: Dockerfile
volumes:
- ./client/:/app/
- ./scripts/client/:/scripts/
ports:
- "3000:3000"
entrypoint:
- /scripts/entrypoint.sh
environment:
- CHOKIDAR_USEPOLLING=True # Enable polling for file changes
- WATCHPACK_POLLING=True
- NODE_ENV=development

backend:
build:
context: ./server
dockerfile: Dockerfile
volumes:
- ./server/:/app/
- ./scripts/server/:/scripts/
ports:
- "5001:5001"
entrypoint:
- /scripts/entrypoint.sh
env_file:
- ./server/.env
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
When i run docker compose up i get the server running in the container and the volume mounting works. But when i try to send a curl request to the server i get the following: curl: (56) Recv failure: Connection reset by peer I have tried to troubleshoot this but i cant find the problem...
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
I have a specific question
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
yes
42 replies
CC#
Created by Keyvan on 7/1/2024 in #help
✅ Issues logging in from frontend via backend API
No description
11 replies