๋ฐ˜์‘ํ˜•

์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” ASP.NET์œผ๋กœ ๋งŒ๋“  ์นด์นด์˜คํ†ก ์ฑ—๋ด‡ ์˜ˆ์ œ ์Šคํ‚ฌ ์„œ๋ฒ„ ์ฝ”๋“œ๋ฅผ ์‹œ๋†€๋กœ์ง€ ์„œ๋ฒ„์— ์—…๋กœ๋“œํ•˜์—ฌ ๋™์ž‘ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์†Œ๊ฐœํ•˜๊ณ ์ž ํ•ฉ๋‹ˆ๋‹ค.

๋ณธ๋ฌธ์„ ์œ„ํ•ด์„œ๋Š” ์ง€๋‚œ ํฌ์ŠคํŒ… ๋‚ด์šฉ์„ ๊ผญ ์ฝ์–ด๋ณด์‹œ๊ธธ ๊ถŒ์žฅ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

[์ฑ—๋ด‡/ASP.NET] C#์œผ๋กœ Microsoft Azure ์„œ๋ฒ„์— ์นด์นด์˜คํ†ก ์˜ˆ์ œ ์Šคํ‚ฌ ์„œ๋ฒ„ ๊ตฌ์ถ•ํ•˜๊ธฐ

 

[์ฑ—๋ด‡/ASP.NET] C#์œผ๋กœ Microsoft Azure ์„œ๋ฒ„์— ์นด์นด์˜คํ†ก ์˜ˆ์ œ ์Šคํ‚ฌ ์„œ๋ฒ„ ๊ตฌ์ถ•ํ•˜๊ธฐ

์ง€๋‚œ ํฌ์ŠคํŒ…์—์„œ ์นด์นด์˜คํ†ก ์ฑ—๋ด‡ ์Šคํ‚ฌ ์„œ๋ฒ„๊ฐ€ ๋ฌด์—‡์ธ์ง€, ๊ทธ๋ฆฌ๊ณ  ์œˆ๋„์šฐ ๊ธฐ๋ฐ˜์—์„œ nvm ๋ฐ nodejs๋ฅผ ์ด์šฉํ•œ ์˜ˆ์ œ ์Šคํ‚ฌ ์„œ๋ฒ„๋ฅผ ์‹คํ–‰ํ•˜๊ณ  ์˜คํ”ˆ ๋นŒ๋” ์Šคํ‚ฌ์— ์—ฐ๋™ํ•ด ๋ณด์•˜์Šต๋‹ˆ๋‹ค. [์ฑ—๋ด‡] ์œˆ๋„์šฐ์—์„œ ์นด์นด

luckygg.tistory.com

๋ณธ๋ฌธ์˜ ๋™์ž‘์€ ์•„๋ž˜ ๋‹ค์ด์–ด๊ทธ๋žจ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Synology Docker๋ฅผ ์ด์šฉํ•œ ์Šคํ‚ฌ ์„œ๋ฒ„ ๋‹ค์ด์–ด๊ทธ๋žจ

๋”ฐ๋ผ ํ•˜๊ธฐ

1. ASP.NET ํ”„๋กœ์ ํŠธ

๋”๋ณด๊ธฐ

์ง€๋‚œ ํฌ์ŠคํŒ…์—์„œ ์‚ฌ์šฉํ•œ ํ”„๋กœ์ ํŠธ๋ฅผ ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ง€๋‚œ ํฌ์ŠคํŒ… ๋‚ด์šฉ์— ์ž์„ธํ•œ ๋‚ด์šฉ์ด ๊ธฐ์ˆ ๋˜์–ด ์žˆ์œผ๋‹ˆ ๊ผญ ์ฝ์–ด๋ณด์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

ํ”„๋กœ์ ํŠธ ๋ฉ”๋‰ด์—์„œ Docker ์ง€์›์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

Docker ์ง€์› ๋ฉ”๋‰ด ํด๋ฆญ

์ดํ›„ Dockerfile์ด ์ƒ์„ฑ๋˜๋ฉฐ, ๊ธฐ๋ณธ ์ƒ์„ฑ๋œ ์ฝ”๋“œ๋Š” ์ง€์šฐ๊ณ  ์•„๋ž˜์˜ ์ฝ”๋“œ๋กœ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.

FROM microsoft/dotnet:2.2-aspnetcore-runtime

COPY . /app
WORKDIR /app

ENV ASPNETCORE_URLS http://*:7552
EXPOSE 7552

ENTRYPOINT ["dotnet", "ExamSkillServer.dll"]
Dockerfile ์ˆ˜์ • ๋‚ด์šฉ

๋นŒ๋“œ ํ›„ ๊ฒŒ์‹œ ๋ฉ”๋‰ด๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค. ๊ฒŒ์‹œ ๋Œ€์ƒ์œผ๋กœ๋Š” ISS, FTP ๋“ฑ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

๊ฒŒ์‹œ ๋Œ€์ƒ ์„ ํƒ ํ™”๋ฉด

์—ฐ๊ฒฐ ํ™”๋ฉด์ด ๋‚˜ํƒ€๋‚˜๋ฉด ๊ฒŒ์‹œ ๋ฐฉ๋ฒ•๊ณผ ๊ฒฝ๋กœ๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ๊ฒฝ๋กœ๋ฅผ ์„ ํƒํ•˜๋ฉด Docker์— ์˜ฌ๋ฆด ํŒŒ์ผ๋“ค์ด ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.

๊ฒŒ์‹œ ๋ฉ”๋‰ด์˜ ์—ฐ๊ฒฐ ํ™”๋ฉด

์„ค์ • ํ™”๋ฉด์—์„œ๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ์˜ต์…˜์„ ์„ ํƒํ•˜๊ณ  ์ €์žฅ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

๊ฒŒ์‹œ ๋ฉ”๋‰ด์˜ ์„ค์ • ํ™”๋ฉด

์„ ํƒํ•œ ๊ฒฝ๋กœ์— ์—ฌ๋Ÿฌ ํŒŒ์ผ๋“ค์ด ์ƒ์„ฑ๋์Šต๋‹ˆ๋‹ค.

Synology Docker์— ์˜ฌ๋ฆด ํŒŒ์ผ๋“ค

๋งŒ์•ฝ, ์ƒ์„ฑ๋œ ํด๋”์— Dockerfile์ด ์กด์žฌํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ ํ”„๋กœ์ ํŠธ์—์„œ ์ƒ์„ฑํ•œ ํŒŒ์ผ์„ ๋ณต์‚ฌํ•ฉ๋‹ˆ๋‹ค.

2. Synology Docker ์„ค์ •ํ•˜๊ธฐ

๋”๋ณด๊ธฐ

Docker ์„ค์ •์ด ๋ณต์žกํ•ด ๋ณด์ผ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฏธ๋ฆฌ ์ฐจ๊ทผ์ฐจ๊ทผ ์ฝ์–ด๋ณธ ํ›„ ๋”ฐ๋ผ ํ•˜์‹œ๊ธธ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

ํ˜น์‹œ๋‚˜ Synology ์„œ๋ฒ„์— Docker๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ์ง€ ์•Š๋‹ค๋ฉด ์„ค์น˜๋ถ€ํ„ฐ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ํŒจํ‚ค์ง€ ์„ผํ„ฐ์—์„œ Docker๋ฅผ ๊ฒ€์ƒ‰ํ•˜๊ณ  ์„ค์น˜๋ฅผ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

Synology DSM์˜ Docker ์„ค์น˜ ํ™”๋ฉด

๋ณ„๋‹ค๋ฅธ ์„ ํƒ ์—†์ด ๋ฐ”๋กœ ์„ค์น˜๊ฐ€ ์™„๋ฃŒ๋ฉ๋‹ˆ๋‹ค.

Docker ์„ค์น˜ ์™„๋ฃŒ ํ™”๋ฉด

File Station์„ ํด๋ฆญํ•˜๊ณ  skillserver๋ผ๋Š” ์ด๋ฆ„์˜ ํด๋”๋ฅผ ํ•˜๋‚˜ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๊ทธ ํด๋”์— 1๋ฒˆ ๋‹จ๊ณ„์—์„œ ์ƒ์„ฑํ•œ ํŒŒ์ผ์„ ๋ชจ๋‘ ์—…๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค.

ํด๋” ์ƒ์„ฑ ๋ฐ ํŒŒ์ผ ์—…๋กœ๋“œ

์ œ์–ดํŒ์—์„œ ํ„ฐ๋ฏธ๋„ ๋ฐ SNMP ๋ฉ”๋‰ด์˜ SSH ์„œ๋น„์Šค ํ™œ์„ฑํ™”๋ฅผ ์ฒดํฌํ•ฉ๋‹ˆ๋‹ค. ํฌํŠธ๋Š” ๊ธฐ๋ณธ ๊ฐ’ 22๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

SSH ์„œ๋น„์Šค ํ™œ์„ฑํ™”

์ด์ œ PuTTY๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. PuTTY๋Š” ์•„๋ž˜์˜ ๋งํฌ์—์„œ ๋‹ค์šด๋กœ๋“œ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

๋งํฌ: www.putty.org/www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

 

Download PuTTY: latest release (0.74)

This page contains download links for the latest released version of PuTTY. Currently this is 0.74, released on 2020-06-27. When new releases come out, this page will update to contain the latest, so this is a good page to bookmark or link to. Alternativel

www.chiark.greenend.org.uk

Synology NAS์˜ IP ์ฃผ์†Œ์™€ SSH ํฌํŠธ์ธ 22๋ฅผ ์ž…๋ ฅํ•˜๊ณ  Open ๋ฒ„ํŠผ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

PuTTY ์—ฐ๊ฒฐ ํ™”๋ฉด

์•„๋ž˜์™€ ๊ฐ™์ด ๋ณด์•ˆ ๊ฒฝ๊ณ  ๋ฉ”์‹œ์ง€๊ฐ€ ํ‘œ์‹œ๋˜๋ฉด ์˜ˆ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•ด์„œ ๋„˜์–ด๊ฐ‘๋‹ˆ๋‹ค.

๋ณด์•ˆ ๊ฒฝ๊ณ  ๋ฉ”์‹œ์ง€

๋‹ค์Œ์œผ๋กœ ์•„๋ž˜์™€ ๊ฐ™์ด ๊ฒ€์€ ํ™”๋ฉด์— login as: ํ™”๋ฉด์ด ํ‘œ์‹œ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค. Synology NAS ๊ด€๋ฆฌ์ž ์•„์ด๋”” ๋ฐ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์•„๋ž˜์˜ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

sudo -i

Password์—๋Š” ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ๊ด€๋ฆฌ์ž ๊ณ„์ •์˜ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

๊ด€๋ฆฌ์ž ๊ณ„์ • ๋กœ๊ทธ์ธ

๊ทธ๋ฆฌ๊ณ  ์•„๋ž˜์˜ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜์—ฌ skillserver ํด๋”๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

cd /volume1/docker/skillserver
skillserver ํด๋”๋กœ ์ด๋™

๋งˆ์ง€๋ง‰์œผ๋กœ ์•„๋ž˜์˜ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜์—ฌ ์„ค์น˜๋ฅผ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

docker build -t skill .

๋งˆ์ง€๋ง‰ ํ•˜๋‹จ์˜ Successfully ๋ฉ”์‹œ์ง€๊ฐ€ ํ‘œ์‹œ๋˜๋ฉด ์„ฑ๊ณต์ ์œผ๋กœ ๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

docker ์„œ๋น„์Šค ์„ค์น˜ ๋ชจ์Šต

3. Docker ์ด๋ฏธ์ง€ ํ™•์ธํ•˜๊ธฐ

๋”๋ณด๊ธฐ

์ด์ œ ์นด์นด์˜คํ†ก ์ฑ—๋ด‡ ์„œ๋ฒ„๊ฐ€ Docker์—์„œ ์ œ๋Œ€๋กœ ๋Œ์•„๊ฐ€๊ณ  ์žˆ๋Š”์ง€ ํ™•์ธํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. Synology DSM์—์„œ Docker๋ฅผ ์‹คํ–‰ํ•˜๊ณ  ์ด๋ฏธ์ง€ ๋ฉ”๋‰ด๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ์ •์ƒ์ ์œผ๋กœ ์„ค์น˜๊ฐ€ ๋๋‹ค๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

Docker์˜ ์ด๋ฏธ์ง€ ํ˜„ํ™ฉ

์ปจํ…Œ์ด๋„ˆ ๋ฉ”๋‰ด๋ฅผ ์„ ํƒํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ์‹คํ–‰ ์ค‘์ด๋ผ๊ณ  ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

Docker์˜ ์ปจํ…Œ์ด๋„ˆ ํ˜„ํ™ฉ

์ปจํ…Œ์ด๋„ˆ๋ฅผ ๋”๋ธ” ํด๋ฆญํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ์ •๋ณด๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

์ปจํ…Œ์ด๋„ˆ ์ •๋ณด

 Synology IP ์ฃผ์†Œ์— 32768 ํฌํŠธ ๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์€ ๋‚ด์šฉ์ด ํ‘œ์‹œ๋˜๋ฉด ๋ฌธ์ œ์—†์ด ์Šคํ‚ฌ ์„œ๋ฒ„๊ฐ€ Synology Docker์—์„œ ์šด์˜๋˜๊ณ  ์žˆ๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์Šคํ‚ฌ ์„œ๋ฒ„ ์‚ฌ์ดํŠธ ํ…Œ์ŠคํŠธ

4. ์นด์นด์˜คํ†ก i ์˜คํ”ˆ ๋นŒ๋”์— ์—ฐ๊ฒฐํ•˜๊ธฐ

๋”๋ณด๊ธฐ

์นด์นด์˜คํ†ก i ์˜คํ”ˆ ๋นŒ๋”์˜ ์Šคํ‚ฌ์˜ URL์— Synology ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

์Šคํ‚ฌ์— URL ์—ฐ๊ฒฐ

ํ•˜๋‹จ์˜ ์Šคํ‚ฌ์„œ๋ฒ„๋กœ ์ „์†ก ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜๋ฉด ์‘๋‹ต ๊ฒฐ๊ณผ๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์Šคํ‚ฌ ์„œ๋ฒ„ ์‘๋‹ต ๊ฒฐ๊ณผ ํ™•์ธ

์ •๋ฆฌ

์ง€๊ธˆ๊นŒ์ง€ ์ฑ—๋ด‡ ์Šคํ‚ฌ ์„œ๋ฒ„ ์ฝ”๋“œ ๊ตฌํ˜„๊ณผ Microsoft Azure ๋ฐ Synology ์„œ๋ฒ„์— ์—…๋กœ๋“œ, ๊ทธ๋ฆฌ๊ณ  ๋งˆ์ง€๋ง‰์œผ๋กœ ์นด์นด์˜ค i ์˜คํ”ˆ ๋นŒ๋”์˜ ์Šคํ‚ฌ์— ์—ฐ๋™ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ์•„๋ดค์Šต๋‹ˆ๋‹ค.

์ถ”ํ›„ ๊ธฐํšŒ๊ฐ€ ๋œ๋‹ค๋ฉด ์˜คํ”ˆ ๋นŒ๋”์˜ ์Šคํ‚ฌ์„ ์‘์šฉํ•˜์—ฌ ์˜ˆ์œ ์ฑ—๋ด‡์„ ๋งŒ๋“œ๋Š” ๊ณผ์ •์„ ์˜ฌ๋ฆฌ๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

๋ฐ˜์‘ํ˜•