diff --git a/.docker/docker-compose.debug.yml b/.docker/docker-compose.debug.yml new file mode 100644 index 0000000..ce5fa67 --- /dev/null +++ b/.docker/docker-compose.debug.yml @@ -0,0 +1,10 @@ +# Please refer https://aka.ms/HTTPSinContainer on how to setup an https developer certificate for your ASP .NET Core service. +version: '3.4' + +services: + internship.api: + environment: + - ASPNETCORE_ENVIRONMENT=Development + - ASPNETCORE_URLS=http://+:80 + volumes: + - ~/.vsdbg:/remote_debugger:rw diff --git a/.docker/docker-compose.yaml b/.docker/docker-compose.yaml index 06af3a6..6d84647 100644 --- a/.docker/docker-compose.yaml +++ b/.docker/docker-compose.yaml @@ -1,9 +1,16 @@ version: "3.3" services: - - internship.api: - image: internship.api:latest - build: ../src/Internship.Api - ports: - - 8080:80 - \ No newline at end of file + + internship.api: + image: internship.api:latest + build: ../src/Internship.Api + ports: + - 8080:80 + + db.postgres: + image: postgres + restart: always + environment: + POSTGRES_PASSWORD: szwoniu + ports: + - 5432:5432 \ No newline at end of file diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..257cb48 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,24 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +README.md \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 1d4bc6e..15cdbfd 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,33 +4,31 @@ // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md "version": "0.2.0", "configurations": [ - { - "name": ".NET Core Launch (web)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/src/Internship.Api/bin/Debug/netcoreapp3.1/Internship.Api.dll", - "args": [], - "cwd": "${workspaceFolder}/src/Internship.Api", - "stopAtEntry": false, - // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser - "serverReadyAction": { - "action": "openExternally", - "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)" - }, - "env": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "sourceFileMap": { - "/Views": "${workspaceFolder}/Views" - } + { + "name": ".NET Core Launch (web)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceFolder}/src/Internship.Api/bin/Debug/netcoreapp3.1/Internship.Api.dll", + "args": [], + "cwd": "${workspaceFolder}/src/Internship.Api", + "stopAtEntry": false, + "serverReadyAction": { + "action": "openExternally", + "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)" }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}" + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "sourceFileMap": { + "/Views": "${workspaceFolder}/Views" } - ] + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } +] } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9ff8d37 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "files.exclude": { + "**/bin": true, + "**/obj": true + } +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a954e09..92fcc64 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -37,6 +37,27 @@ "/consoleloggerparameters:NoSummary" ], "problemMatcher": "$msCompile" - } + }, + { + "label": "up", + "type": "shell", + "command": "docker-compose", + "args": [ + "-f", + ".docker/docker-compose.yaml", + "up", + "--build" + ], + "problemMatcher": [] + }, + { + "label": "dotnet restore", + "type": "shell", + "command": "dotnet", + "args": [ + "restore" + ], + "problemMatcher": [] + }, ] } \ No newline at end of file diff --git a/global.json b/global.json index cc4d115..65cf76e 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "3.1.200" + "version": "3.1.103" } } \ No newline at end of file diff --git a/src/Internship.Api/.dockerignore b/src/Internship.Api/.dockerignore deleted file mode 100644 index a02c9ed..0000000 --- a/src/Internship.Api/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -bin\ -obj\ \ No newline at end of file