1- codingteam.org.ru
1+ codingteam.org.ru [ ![ Docker Image ] [ badge.docker ]] [ docker-hub ]
22=================
33
44This is the code that services [ codingteam.org.ru] [ ] website.
55
6- ### Prerequisites
6+ Prerequisites
7+ -------------
78
89To build the application, you'll need to install [ .NET Core SDK] [ dotnet ]
9- 3.1.201+ and [ Node.js ] [ node-js ] 6.14+.
10+ 3.1.201+ and [ NPM ] [ npm ] 6.14+.
1011
1112To run the application, [ .NET Core Runtime] [ dotnet ] 3.1 is required.
1213
13- ### Configuration
14+ Configure
15+ ---------
1416
1517The only configuration parameter is the HTTP binding. Change the binding using
1618` ASPNETCORE_URLS ` environment variable. For example,
@@ -27,7 +29,8 @@ You may specify the application settings in the `appsettings.json` file. The
2729},
2830```
2931
30- ### Building
32+ Build
33+ -----
3134
3235Prepare for the build (set the dependencies up):
3336
@@ -42,33 +45,78 @@ $ npm run build
4245$ dotnet build
4346```
4447
45- Execute the local build:
48+ Run
49+ ---
4650
4751``` console
4852$ dotnet run --project Codingteam.Site
4953```
5054
51- Prepare the production-ready package:
55+ Test
56+ ----
57+
58+ To run the project tests, execute the following command:
5259
5360``` console
54- $ dotnet publish -c release
61+ $ dotnet test --configuration Release
5562```
5663
57- ### Test
64+ Publish
65+ -------
5866
59- To run the project tests, execute the following command:
67+ Prepare the production-ready distribution in the ` publish ` directory:
68+
69+ ``` console
70+ $ dotnet publish --configuration Release --output publish Codingteam.Site
71+ ```
72+
73+ This application uses Docker for deployment. To create a Docker image, use the
74+ following command:
75+
76+ ``` console
77+ $ docker build -t revenrof/codingteam.org.ru:$CODINGTEAM_ORG_RU_VERSION -t revenrof/codingteam.org.ru:latest .
78+ ```
79+
80+ (where ` $CODINGTEAM_ORG_RU_VERSION ` is the version for the image to use)
81+
82+ Then push the image to the Docker Hub:
6083
6184``` console
62- $ dotnet test
85+ $ docker login # if necessary
86+ $ docker push revenrof/codingteam.org.ru:$CODINGTEAM_ORG_RU_VERSION
87+ $ docker push revenrof/codingteam.org.ru:latest
6388```
6489
65- ### Deployment
90+ Deploy
91+ ------
92+
93+ To install the application from Docker, run the following command:
94+
95+ ``` console
96+ $ docker run -d --restart unless-stopped -p:$PORT :80 --name $NAME -v $CONFIG :/app/appsettings.json revenrof/codingteam.org.ru:$VERSION
97+ ```
98+
99+ Where
100+ - ` $PORT ` is the port you want to expose the application on
101+ - ` $NAME ` is the container name
102+ - ` $CONFIG ` is the ** absolute** path to the configuration file override (if
103+ necessary)
104+ - ` $VERSION ` is the version you want to deploy, or ` latest ` for the latest
105+ available one
106+
107+ For example, a production server may use the following settings (note this
108+ command uses the Bash syntax; adapt for your shell if necessary):
109+
110+ ``` bash
111+ PORT=5000
112+ NAME=codingteam.org.ru
113+ VERSION=latest
114+ docker run -d --restart unless-stopped -p $PORT :80 --name $NAME revenrof/codingteam.org.ru:$VERSION
115+ ```
66116
67- The site can be deployed to any platform capable of running [ dotnet] [ ] . See
68- [ deployment documentation] [ deployment ] for information about current production
69- environment.
117+ [ badge.docker ] : https://img.shields.io/docker/v/revenrof/codingteam.org.ru?sort=semver
70118
71119[ codingteam.org.ru ] : https://codingteam.org.ru/
72- [ deployment ] : docs/deployment.md
120+ [ docker-hub ] : https://hub.docker.com/r/revenrof/codingteam.org.ru
73121[ dotnet ] : https://dot.net/
74- [ node-js ] : https://nodejs.org/en/
122+ [ npm ] : https://npmjs.com
0 commit comments