Skip to content
This repository was archived by the owner on Mar 14, 2023. It is now read-only.

Commit 777b937

Browse files
committed
Update to Compose V2
1 parent e08ac84 commit 777b937

File tree

164 files changed

+16165
-41554
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+16165
-41554
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,12 @@ L09-05 Docker Compose - Sample App/vote/dotnet/Vote/obj/Debug/netcoreapp2.1/Vote
1717
L09-05 Docker Compose - Sample App/vote/dotnet/Vote/obj/Debug/netcoreapp2.1/Vote.csproj.AssemblyReference.cache
1818
L09-05 Docker Compose - Sample App/worker/dotnet/Worker/obj/Debug/netcoreapp2.1/Worker.assets.cache
1919
L09-05 Docker Compose - Sample App/worker/dotnet/Worker/obj/Debug/netcoreapp2.1/Worker.csproj.AssemblyReference.cache
20+
L07-02 Multi Stage Build/obj/Debug/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs
21+
L07-02 Multi Stage Build/obj/Debug/net6.0/Code.AssemblyInfo.cs
22+
L07-02 Multi Stage Build/obj/Debug/net6.0/Code.AssemblyInfoInputs.cache
23+
L07-02 Multi Stage Build/obj/Debug/net6.0/Code.csproj.AssemblyReference.cache
24+
L07-02 Multi Stage Build/obj/Debug/net6.0/Code.GeneratedMSBuildEditorConfig.editorconfig
25+
L07-02 Multi Stage Build/obj/Debug/net6.0/Code.GlobalUsings.g.cs
26+
L07-02 Multi Stage Build/obj/Debug/net6.0/Code.RazorAssemblyInfo.cache
27+
L07-02 Multi Stage Build/obj/Debug/net6.0/Code.RazorAssemblyInfo.cs
28+
L07-02 Multi Stage Build/obj/Debug/net6.0/project.razor.json
Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
1-
version: "3.5"
21
services:
32
web-fe:
43
build: .
54
command: python app.py
65
ports:
7-
- target: 5000
8-
published: 5000
9-
networks:
10-
- counter-net
11-
volumes:
12-
- type: volume
13-
source: counter-vol
14-
target: /code
6+
- 5000:5000
157
redis:
168
image: "redis:alpine"
17-
networks:
18-
counter-net:
19-
20-
networks:
21-
counter-net:
22-
23-
volumes:
24-
counter-vol:
9+
ports:
10+
- 6379

L09-05 Docker Compose - Sample App/ExampleVotingApp.sln

Lines changed: 0 additions & 37 deletions
This file was deleted.

L09-05 Docker Compose - Sample App/LICENSE

Lines changed: 0 additions & 191 deletions
This file was deleted.

L09-05 Docker Compose - Sample App/MAINTAINERS

Lines changed: 0 additions & 5 deletions
This file was deleted.
-53.5 KB
Binary file not shown.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# if you're doing anything beyond your local machine, please pin this to a specific version at https://hub.docker.com/_/node/
2+
FROM node:lts
3+
4+
# set our node environment, either development or production
5+
# defaults to production, compose overrides this to development on build and run
6+
ARG NODE_ENV=production
7+
ENV NODE_ENV $NODE_ENV
8+
9+
WORKDIR /code
10+
11+
# default to port 80 for node, and 9229 and 9230 (tests) for debug
12+
ARG PORT=80
13+
ENV PORT $PORT
14+
EXPOSE $PORT 9229 9230
15+
16+
COPY package.json /code/package.json
17+
COPY package-lock.json /code/package-lock.json
18+
RUN npm ci
19+
20+
# check every 30s to ensure this service returns HTTP 200
21+
HEALTHCHECK --interval=30s \
22+
CMD node healthcheck.js
23+
24+
# copy in our source code last, as it changes the most
25+
COPY . /code
26+
27+
# if you want to use npm start instead, then use `docker run --init in production`
28+
# so that signals are passed properly. Note the code in index.js is needed to catch Docker signals
29+
# using node here is still more graceful stopping then npm with --init afaik
30+
# I still can't come up with a good production way to run with npm and graceful shutdown
31+
CMD [ "node", "src/index.js" ]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2015-2017 Bret Fisher
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const http = require("http");
2+
3+
const options = {
4+
timeout: 2000,
5+
host: "localhost",
6+
port: process.env.PORT || 8080,
7+
path: "/healthz" // must be the same as HEALTHCHECK in Dockerfile
8+
};
9+
10+
const request = http.request(options, res => {
11+
console.info("STATUS: " + res.statusCode);
12+
process.exitCode = res.statusCode === 200 ? 0 : 1;
13+
process.exit();
14+
});
15+
16+
request.on("error", function(err) {
17+
console.error("ERROR", err);
18+
process.exit(1);
19+
});
20+
21+
request.end();

0 commit comments

Comments
 (0)