From daafd76d7c034e6e0944c66314e479f54dc42602 Mon Sep 17 00:00:00 2001 From: Eden Kirin Date: Mon, 15 Jan 2024 00:04:46 +0100 Subject: [PATCH] Add new products container --- docker-compose.yml | 25 +- machines/Dockerfile | 5 +- media/demo-overview.excalidraw | 703 +++++++++++++++++++++++++-------- products/Dockerfile | 5 +- proxy/envoy.yaml | 7 +- 5 files changed, 567 insertions(+), 178 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b2d94c7..85d27be 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,13 +24,25 @@ services: - DBNAME=komponiranje - DBUSER=pero - DBPASSWORD=pero.000 - - PRODUCTSAPPURL=http://products-app:3000 - # ports: - # - 3000:3000 + - PRODUCTSAPPURL=http://proxy:10000 depends_on: db: condition: service_healthy - products-app: + products-app-1: + build: + context: ./products + dockerfile: Dockerfile + environment: + - APPPORT=3000 + - DBHOST=db + - DBPORT=5432 + - DBNAME=komponiranje + - DBUSER=pero + - DBPASSWORD=pero.000 + depends_on: + db: + condition: service_healthy + products-app-2: build: context: ./products dockerfile: Dockerfile @@ -41,8 +53,6 @@ services: - DBNAME=komponiranje - DBUSER=pero - DBPASSWORD=pero.000 - # ports: - # - 3000:3000 depends_on: db: condition: service_healthy @@ -54,4 +64,5 @@ services: - ./proxy/envoy.yaml:/etc/envoy/envoy.yaml depends_on: - machines-app - - products-app + - products-app-1 + - products-app-2 diff --git a/machines/Dockerfile b/machines/Dockerfile index 199f4b8..1ec9804 100644 --- a/machines/Dockerfile +++ b/machines/Dockerfile @@ -1,4 +1,4 @@ -# stage 2: build golang backend +# stage 1: build golang backend FROM golang:1.21-alpine3.19 as go-builder WORKDIR /go-builder @@ -13,8 +13,9 @@ RUN \ # stage 2: build final container FROM alpine:3.19 -USER $USER WORKDIR /app COPY --from=go-builder /go-builder/machines-app /app +USER 33 + ENTRYPOINT ["/app/machines-app"] diff --git a/media/demo-overview.excalidraw b/media/demo-overview.excalidraw index 1a35792..2064fdb 100644 --- a/media/demo-overview.excalidraw +++ b/media/demo-overview.excalidraw @@ -79,8 +79,8 @@ }, { "type": "rectangle", - "version": 398, - "versionNonce": 591914896, + "version": 399, + "versionNonce": 145430395, "isDeleted": false, "id": "IdWgQ7K35j_LT3pdoxDq0", "fillStyle": "solid", @@ -119,16 +119,20 @@ { "id": "GxvBGakscR8qvQ3hBN8J-", "type": "arrow" + }, + { + "id": "12ktETjUSPoRsMJk3PXBy", + "type": "arrow" } ], - "updated": 1705138387381, + "updated": 1705272424719, "link": null, "locked": false }, { "type": "text", - "version": 321, - "versionNonce": 1882392976, + "version": 329, + "versionNonce": 2098468859, "isDeleted": false, "id": "ZHqsaRuDQUewUhGNV7xf5", "fillStyle": "cross-hatch", @@ -137,11 +141,11 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 3914.2498527873227, + "x": 3872.1376701701347, "y": -10886.138313627078, "strokeColor": "#2f9e44", "backgroundColor": "transparent", - "width": 71.6802978515625, + "width": 155.9046630859375, "height": 35, "seed": 268580720, "groupIds": [ @@ -150,18 +154,18 @@ "frameId": null, "roundness": null, "boundElements": [], - "updated": 1705138387381, + "updated": 1705272545792, "link": null, "locked": false, "fontSize": 28, "fontFamily": 1, - "text": "envoy", + "text": "envoy proxy", "textAlign": "center", "verticalAlign": "middle", "containerId": "IdWgQ7K35j_LT3pdoxDq0", - "originalText": "envoy", + "originalText": "envoy proxy", "lineHeight": 1.25, - "baseline": 26 + "baseline": 23 }, { "type": "rectangle", @@ -469,8 +473,8 @@ }, { "type": "rectangle", - "version": 281, - "versionNonce": 1695751536, + "version": 344, + "versionNonce": 1251908725, "isDeleted": false, "id": "ai0osAWJ1RBoQ4JBro3L0", "fillStyle": "cross-hatch", @@ -479,8 +483,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4932.045318203683, - "y": -10965.772824160624, + "x": 5125.188105592076, + "y": -10988.629967017767, "strokeColor": "#1971c2", "backgroundColor": "#a5d8ff", "width": 441.67839738100747, @@ -499,14 +503,14 @@ "id": "Lcioux1OAkfxYsRwg7tPh" } ], - "updated": 1705138706089, + "updated": 1705272385235, "link": null, "locked": false }, { "type": "text", - "version": 216, - "versionNonce": 833482608, + "version": 279, + "versionNonce": 769476053, "isDeleted": false, "id": "Lcioux1OAkfxYsRwg7tPh", "fillStyle": "cross-hatch", @@ -515,8 +519,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 5012.827937304342, - "y": -10960.772824160624, + "x": 5205.9707246927355, + "y": -10983.629967017767, "strokeColor": "#1971c2", "backgroundColor": "#a5d8ff", "width": 280.1131591796875, @@ -528,7 +532,7 @@ "frameId": null, "roundness": null, "boundElements": [], - "updated": 1705138706089, + "updated": 1705272385235, "link": null, "locked": false, "fontSize": 28, @@ -543,8 +547,8 @@ }, { "type": "rectangle", - "version": 445, - "versionNonce": 119439728, + "version": 508, + "versionNonce": 2050999093, "isDeleted": false, "id": "wUuH6P3y0n2bIbcULauqL", "fillStyle": "solid", @@ -553,8 +557,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4967.537817230076, - "y": -10892.081485608365, + "x": 5160.680604618469, + "y": -10914.938628465508, "strokeColor": "#2f9e44", "backgroundColor": "#b2f2bb", "width": 370.6933993282196, @@ -581,14 +585,14 @@ "type": "arrow" } ], - "updated": 1705138706089, + "updated": 1705272385235, "link": null, "locked": false }, { "type": "text", - "version": 397, - "versionNonce": 1118804848, + "version": 460, + "versionNonce": 1824863061, "isDeleted": false, "id": "TtJzzXuOaQrik6UMq4Jrt", "fillStyle": "cross-hatch", @@ -597,8 +601,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 5094.42026823696, - "y": -10841.60068844186, + "x": 5287.563055625353, + "y": -10864.457831299003, "strokeColor": "#2f9e44", "backgroundColor": "transparent", "width": 116.92849731445312, @@ -610,7 +614,7 @@ "frameId": null, "roundness": null, "boundElements": [], - "updated": 1705138706089, + "updated": 1705272385235, "link": null, "locked": false, "fontSize": 28, @@ -677,8 +681,8 @@ }, { "type": "arrow", - "version": 503, - "versionNonce": 23827856, + "version": 746, + "versionNonce": 987416411, "isDeleted": false, "id": "RhRkQFd2AVMdyJzXPC51f", "fillStyle": "cross-hatch", @@ -687,12 +691,12 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4137.978483765599, - "y": -10886.663585084398, + "x": 4138.5006918313, + "y": -10915.373079875531, "strokeColor": "#1e1e1e", "backgroundColor": "#a5d8ff", - "width": 200.39096969426646, - "height": 270.5724076759434, + "width": 393.01154901695827, + "height": 281.5830979902312, "seed": 671174000, "groupIds": [], "frameId": null, @@ -700,18 +704,18 @@ "type": 2 }, "boundElements": [], - "updated": 1705138410406, + "updated": 1705272472280, "link": null, "locked": false, "startBinding": { "elementId": "IdWgQ7K35j_LT3pdoxDq0", - "focus": 0.7410092967442677, - "gap": 2.541782388385627 + "focus": 0.4395762009135872, + "gap": 3.063990454086934 }, "endBinding": { "elementId": "n75eoynQQIjXOS72X19Jr", - "focus": 0.8237294536588164, - "gap": 1.1884448860569137 + "focus": 0.8008414429580962, + "gap": 1.188444886056459 }, "lastCommittedPoint": null, "startArrowhead": null, @@ -722,15 +726,15 @@ 0 ], [ - 200.39096969426646, - -270.5724076759434 + 393.01154901695827, + -281.5830979902312 ] ] }, { "type": "arrow", - "version": 785, - "versionNonce": 1012781968, + "version": 972, + "versionNonce": 367591387, "isDeleted": false, "id": "GxvBGakscR8qvQ3hBN8J-", "fillStyle": "cross-hatch", @@ -739,12 +743,12 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4136.4367013772135, - "y": -10835.8121085344, + "x": 4135.914493311512, + "y": -10825.001805017082, "strokeColor": "#1e1e1e", "backgroundColor": "#a5d8ff", - "width": 204.6235286040628, - "height": 361.30222411908835, + "width": 398.28852405815724, + "height": 358.11152052741454, "seed": 675507056, "groupIds": [], "frameId": null, @@ -752,17 +756,17 @@ "type": 2 }, "boundElements": [], - "updated": 1705138396190, + "updated": 1705272477606, "link": null, "locked": false, "startBinding": { "elementId": "IdWgQ7K35j_LT3pdoxDq0", - "focus": -0.7500072016304519, + "focus": -0.5261163283059266, "gap": 1 }, "endBinding": { "elementId": "A7BseBs_mEzk9-lk1eJj_", - "focus": -0.7857291317579581, + "focus": -0.7652501739770003, "gap": 1 }, "lastCommittedPoint": null, @@ -774,15 +778,15 @@ 0 ], [ - 204.6235286040628, - 361.30222411908835 + 398.28852405815724, + 358.11152052741454 ] ] }, { "type": "arrow", - "version": 267, - "versionNonce": 547415408, + "version": 468, + "versionNonce": 1356017691, "isDeleted": false, "id": "waoFatUFaAnlvBo9y6yfH", "fillStyle": "cross-hatch", @@ -791,8 +795,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4711.887607541466, - "y": -11153.184282730974, + "x": 4905.0303949298595, + "y": -11176.041425588117, "strokeColor": "#1e1e1e", "backgroundColor": "#a5d8ff", "width": 254.65020968860972, @@ -804,18 +808,18 @@ "type": 2 }, "boundElements": [], - "updated": 1705138706089, + "updated": 1705272385629, "link": null, "locked": false, "startBinding": { "elementId": "n75eoynQQIjXOS72X19Jr", - "focus": -0.7926657031299634, - "gap": 1.6363098673241439 + "focus": -0.7930567958349166, + "gap": 1.6363098673245986 }, "endBinding": { "elementId": "wUuH6P3y0n2bIbcULauqL", - "focus": -0.6807926534852622, - "gap": 1 + "focus": -0.6807926534852702, + "gap": 1.0000000000004547 }, "lastCommittedPoint": null, "startArrowhead": null, @@ -833,8 +837,8 @@ }, { "type": "arrow", - "version": 446, - "versionNonce": 2145012080, + "version": 647, + "versionNonce": 1584670043, "isDeleted": false, "id": "kUvKwE5bb6v-aDmquYB91", "fillStyle": "cross-hatch", @@ -843,8 +847,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4715.295619706436, - "y": -10452.89828224272, + "x": 4908.438407094829, + "y": -10475.755425099864, "strokeColor": "#1e1e1e", "backgroundColor": "#a5d8ff", "width": 251.24219752364024, @@ -856,18 +860,18 @@ "type": 2 }, "boundElements": [], - "updated": 1705138706089, + "updated": 1705272385630, "link": null, "locked": false, "startBinding": { "elementId": "A7BseBs_mEzk9-lk1eJj_", - "focus": 0.8139415579822314, + "focus": 0.8143068746561463, "gap": 2.541990396939582 }, "endBinding": { "elementId": "wUuH6P3y0n2bIbcULauqL", - "focus": 0.7490125782834043, - "gap": 1 + "focus": 0.7490125782834083, + "gap": 1.0000000000004547 }, "lastCommittedPoint": null, "startArrowhead": null, @@ -885,22 +889,22 @@ }, { "type": "arrow", - "version": 158, - "versionNonce": 862735760, + "version": 453, + "versionNonce": 988590555, "isDeleted": false, "id": "fz4-v3BbLpHUlDxmoU9oC", "fillStyle": "cross-hatch", "strokeWidth": 2, - "strokeStyle": "solid", + "strokeStyle": "dotted", "roughness": 2, "opacity": 60, "angle": 0, - "x": 4524.226573006812, - "y": -11074.829265441811, + "x": 4717.369360395205, + "y": -11097.686408298954, "strokeColor": "#1e1e1e", "backgroundColor": "#a5d8ff", - "width": 5.137432183983037, - "height": 541.8739342302797, + "width": 581.4057282513213, + "height": 273.2944022042084, "seed": 988591472, "groupIds": [], "frameId": null, @@ -908,18 +912,18 @@ "type": 2 }, "boundElements": [], - "updated": 1705138410406, + "updated": 1705272590362, "link": null, "locked": false, "startBinding": { "elementId": "n75eoynQQIjXOS72X19Jr", - "focus": 0.0073218695934150375, + "focus": -0.4629668551967658, "gap": 4.146152978244572 }, "endBinding": { - "elementId": "A7BseBs_mEzk9-lk1eJj_", - "focus": 0.01444339203977214, - "gap": 8.93926342423947 + "elementId": "9D7Gw2OyaxH8PvxvmUAw1", + "focus": 0.974309658080423, + "gap": 9.357206134031003 }, "lastCommittedPoint": null, "startArrowhead": null, @@ -930,15 +934,15 @@ 0 ], [ - 5.137432183983037, - 541.8739342302797 + -581.4057282513213, + 273.2944022042084 ] ] }, { "type": "rectangle", - "version": 396, - "versionNonce": 2073692528, + "version": 459, + "versionNonce": 260726997, "isDeleted": false, "id": "YPhfkjzNcQxaFwAcVmQUU", "fillStyle": "cross-hatch", @@ -947,8 +951,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4304.065399319528, - "y": -11287.031362185682, + "x": 4497.208186707921, + "y": -11309.888505042825, "strokeColor": "#1971c2", "backgroundColor": "#a5d8ff", "width": 441.67839738100747, @@ -967,14 +971,14 @@ "id": "3v1ShPfiBCgX1ECWIRrnP" } ], - "updated": 1705138671840, + "updated": 1705272385235, "link": null, "locked": false }, { "type": "text", - "version": 300, - "versionNonce": 704218512, + "version": 363, + "versionNonce": 2106687029, "isDeleted": false, "id": "3v1ShPfiBCgX1ECWIRrnP", "fillStyle": "cross-hatch", @@ -983,8 +987,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4395.194057238547, - "y": -11282.031362185682, + "x": 4588.336844626941, + "y": -11304.888505042825, "strokeColor": "#1971c2", "backgroundColor": "#a5d8ff", "width": 259.42108154296875, @@ -996,7 +1000,7 @@ "frameId": null, "roundness": null, "boundElements": [], - "updated": 1705138671840, + "updated": 1705272385235, "link": null, "locked": false, "fontSize": 28, @@ -1011,8 +1015,8 @@ }, { "type": "rectangle", - "version": 344, - "versionNonce": 813128560, + "version": 407, + "versionNonce": 1267593109, "isDeleted": false, "id": "n75eoynQQIjXOS72X19Jr", "fillStyle": "solid", @@ -1021,8 +1025,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4339.557898345922, - "y": -11214.937012753066, + "x": 4532.700685734315, + "y": -11237.794155610209, "strokeColor": "#2f9e44", "backgroundColor": "#b2f2bb", "width": 370.6933993282196, @@ -1053,14 +1057,14 @@ "type": "arrow" } ], - "updated": 1705138671840, + "updated": 1705272385235, "link": null, "locked": false }, { "type": "text", - "version": 280, - "versionNonce": 970085264, + "version": 343, + "versionNonce": 35426933, "isDeleted": false, "id": "tRbFn4eaW1fPFGHbh26_R", "fillStyle": "cross-hatch", @@ -1069,8 +1073,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4437.75423790261, - "y": -11164.45621558656, + "x": 4630.897025291003, + "y": -11187.313358443704, "strokeColor": "#2f9e44", "backgroundColor": "transparent", "width": 174.30072021484375, @@ -1082,7 +1086,7 @@ "frameId": null, "roundness": null, "boundElements": [], - "updated": 1705138671840, + "updated": 1705272385236, "link": null, "locked": false, "fontSize": 28, @@ -1097,8 +1101,8 @@ }, { "type": "text", - "version": 246, - "versionNonce": 990974773, + "version": 309, + "versionNonce": 1848409045, "isDeleted": false, "id": "RExyWP6iEbwZEwWGJ7ynn", "fillStyle": "cross-hatch", @@ -1107,8 +1111,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4350.018998485362, - "y": -11049.523636914335, + "x": 4543.161785873755, + "y": -11072.380779771478, "strokeColor": "#1e1e1e", "backgroundColor": "#a5d8ff", "width": 339.84375, @@ -1120,7 +1124,7 @@ "frameId": null, "roundness": null, "boundElements": [], - "updated": 1705145571167, + "updated": 1705272385236, "link": null, "locked": false, "fontSize": 20, @@ -1135,8 +1139,8 @@ }, { "type": "rectangle", - "version": 592, - "versionNonce": 1025580400, + "version": 655, + "versionNonce": 389560629, "isDeleted": false, "id": "VwKFGNiRjQbbSavZfiH7u", "fillStyle": "cross-hatch", @@ -1145,8 +1149,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4306.567730954883, - "y": -10602.926883568032, + "x": 4499.710518343276, + "y": -10625.784026425175, "strokeColor": "#1971c2", "backgroundColor": "#a5d8ff", "width": 441.67839738100747, @@ -1165,14 +1169,14 @@ "id": "65GKihY2pwS9D03KoVJx7" } ], - "updated": 1705138674276, + "updated": 1705272385236, "link": null, "locked": false }, { "type": "text", - "version": 531, - "versionNonce": 1998434704, + "version": 594, + "versionNonce": 379931285, "isDeleted": false, "id": "65GKihY2pwS9D03KoVJx7", "fillStyle": "cross-hatch", @@ -1181,8 +1185,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4395.078377399293, - "y": -10597.926883568032, + "x": 4588.221164787686, + "y": -10620.784026425175, "strokeColor": "#1971c2", "backgroundColor": "#a5d8ff", "width": 264.6571044921875, @@ -1194,7 +1198,7 @@ "frameId": null, "roundness": null, "boundElements": [], - "updated": 1705138674276, + "updated": 1705272385236, "link": null, "locked": false, "fontSize": 28, @@ -1209,8 +1213,8 @@ }, { "type": "rectangle", - "version": 542, - "versionNonce": 1476128624, + "version": 605, + "versionNonce": 1026109429, "isDeleted": false, "id": "A7BseBs_mEzk9-lk1eJj_", "fillStyle": "solid", @@ -1219,8 +1223,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4342.060229981276, - "y": -10524.016067787292, + "x": 4535.203017369669, + "y": -10546.873210644435, "strokeColor": "#2f9e44", "backgroundColor": "#b2f2bb", "width": 370.6933993282196, @@ -1251,14 +1255,14 @@ "type": "arrow" } ], - "updated": 1705138674276, + "updated": 1705272385236, "link": null, "locked": false }, { "type": "text", - "version": 475, - "versionNonce": 697368464, + "version": 541, + "versionNonce": 144855451, "isDeleted": false, "id": "OqcOXay_DWRyOtRdobP08", "fillStyle": "cross-hatch", @@ -1267,11 +1271,11 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4438.12854829773, - "y": -10473.535270620787, + "x": 4620.477291191494, + "y": -10496.39241347793, "strokeColor": "#2f9e44", "backgroundColor": "transparent", - "width": 178.5567626953125, + "width": 200.1448516845703, "height": 35, "seed": 159580560, "groupIds": [ @@ -1280,23 +1284,23 @@ "frameId": null, "roundness": null, "boundElements": [], - "updated": 1705138674276, + "updated": 1705272608047, "link": null, "locked": false, "fontSize": 28, "fontFamily": 1, - "text": "products app", + "text": "products app 1", "textAlign": "center", "verticalAlign": "middle", "containerId": "A7BseBs_mEzk9-lk1eJj_", - "originalText": "products app", + "originalText": "products app 1", "lineHeight": 1.25, - "baseline": 26 + "baseline": 23 }, { "type": "text", - "version": 288, - "versionNonce": 145008283, + "version": 351, + "versionNonce": 1647572021, "isDeleted": false, "id": "FCRGzjxk1UBzWmGqDlFB5", "fillStyle": "cross-hatch", @@ -1305,8 +1309,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4360.01910248964, - "y": -10357.268285652257, + "x": 4553.161889878033, + "y": -10380.1254285094, "strokeColor": "#1e1e1e", "backgroundColor": "#a5d8ff", "width": 234.375, @@ -1318,7 +1322,209 @@ "frameId": null, "roundness": null, "boundElements": [], - "updated": 1705145571167, + "updated": 1705272385236, + "link": null, + "locked": false, + "fontSize": 20, + "fontFamily": 3, + "text": "/products\n/products/:productId", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "/products\n/products/:productId", + "lineHeight": 1.2, + "baseline": 43 + }, + { + "type": "rectangle", + "version": 715, + "versionNonce": 740626619, + "isDeleted": false, + "id": "4H8oN-ypeQCBWDzOVtVQW", + "fillStyle": "cross-hatch", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 2, + "opacity": 60, + "angle": 0, + "x": 4507.424838934794, + "y": -10259.21263273098, + "strokeColor": "#1971c2", + "backgroundColor": "#a5d8ff", + "width": 441.67839738100747, + "height": 328.5320658905167, + "seed": 2045641461, + "groupIds": [ + "DN5WiDXtCrKduHSDhTLYu" + ], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "type": "text", + "id": "X4Z5tuXdxKYRPhNP4Q9gb" + } + ], + "updated": 1705272407799, + "link": null, + "locked": false + }, + { + "type": "text", + "version": 653, + "versionNonce": 2019115355, + "isDeleted": false, + "id": "X4Z5tuXdxKYRPhNP4Q9gb", + "fillStyle": "cross-hatch", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 2, + "opacity": 60, + "angle": 0, + "x": 4595.935485379204, + "y": -10254.21263273098, + "strokeColor": "#1971c2", + "backgroundColor": "#a5d8ff", + "width": 264.6571044921875, + "height": 35, + "seed": 1713345243, + "groupIds": [ + "DN5WiDXtCrKduHSDhTLYu" + ], + "frameId": null, + "roundness": null, + "boundElements": null, + "updated": 1705272407799, + "link": null, + "locked": false, + "fontSize": 28, + "fontFamily": 1, + "text": "Products Container", + "textAlign": "center", + "verticalAlign": "top", + "containerId": "4H8oN-ypeQCBWDzOVtVQW", + "originalText": "Products Container", + "lineHeight": 1.25, + "baseline": 26 + }, + { + "type": "rectangle", + "version": 666, + "versionNonce": 2051126459, + "isDeleted": false, + "id": "sgmwBqZMfXCJB7d57hCMQ", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 2, + "opacity": 60, + "angle": 0, + "x": 4542.9173379611875, + "y": -10180.30181695024, + "strokeColor": "#2f9e44", + "backgroundColor": "#b2f2bb", + "width": 370.6933993282196, + "height": 135.96159433301, + "seed": 997973077, + "groupIds": [ + "DN5WiDXtCrKduHSDhTLYu" + ], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "id": "GxvBGakscR8qvQ3hBN8J-", + "type": "arrow" + }, + { + "id": "kUvKwE5bb6v-aDmquYB91", + "type": "arrow" + }, + { + "id": "fz4-v3BbLpHUlDxmoU9oC", + "type": "arrow" + }, + { + "type": "text", + "id": "EnUpsUDbjeySL8HabFf0F" + }, + { + "id": "12ktETjUSPoRsMJk3PXBy", + "type": "arrow" + } + ], + "updated": 1705272424719, + "link": null, + "locked": false + }, + { + "type": "text", + "version": 600, + "versionNonce": 1326260571, + "isDeleted": false, + "id": "EnUpsUDbjeySL8HabFf0F", + "fillStyle": "cross-hatch", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 2, + "opacity": 60, + "angle": 0, + "x": 4622.017585293755, + "y": -10129.821019783734, + "strokeColor": "#2f9e44", + "backgroundColor": "transparent", + "width": 212.49290466308594, + "height": 35, + "seed": 805207931, + "groupIds": [ + "DN5WiDXtCrKduHSDhTLYu" + ], + "frameId": null, + "roundness": null, + "boundElements": null, + "updated": 1705272612955, + "link": null, + "locked": false, + "fontSize": 28, + "fontFamily": 1, + "text": "products app 2", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "sgmwBqZMfXCJB7d57hCMQ", + "originalText": "products app 2", + "lineHeight": 1.25, + "baseline": 23 + }, + { + "type": "text", + "version": 409, + "versionNonce": 1364548411, + "isDeleted": false, + "id": "u1OuuXnvKcO5rBbQ9og-m", + "fillStyle": "cross-hatch", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 2, + "opacity": 60, + "angle": 0, + "x": 4560.876210469552, + "y": -10013.554034815204, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "width": 234.375, + "height": 48, + "seed": 885492149, + "groupIds": [ + "DN5WiDXtCrKduHSDhTLYu" + ], + "frameId": null, + "roundness": null, + "boundElements": null, + "updated": 1705272407799, "link": null, "locked": false, "fontSize": 20, @@ -1333,8 +1539,8 @@ }, { "type": "text", - "version": 34, - "versionNonce": 1301018997, + "version": 97, + "versionNonce": 544318869, "isDeleted": false, "id": "puauPPmatsxiYK7nuxUmV", "fillStyle": "cross-hatch", @@ -1343,8 +1549,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4849.571590218243, - "y": -11045.520314021142, + "x": 5042.714377606636, + "y": -11068.377456878285, "strokeColor": "#1e1e1e", "backgroundColor": "#a5d8ff", "width": 164.0625, @@ -1354,7 +1560,7 @@ "frameId": null, "roundness": null, "boundElements": [], - "updated": 1705232206804, + "updated": 1705272385236, "link": null, "locked": false, "fontSize": 20, @@ -1369,8 +1575,8 @@ }, { "type": "text", - "version": 84, - "versionNonce": 945004187, + "version": 147, + "versionNonce": 582101749, "isDeleted": false, "id": "ZR8aurk5K826Erslgmf7s", "fillStyle": "cross-hatch", @@ -1379,8 +1585,8 @@ "roughness": 2, "opacity": 60, "angle": 0, - "x": 4865.024326478773, - "y": -10635.419732655551, + "x": 5058.167113867166, + "y": -10658.276875512694, "strokeColor": "#1e1e1e", "backgroundColor": "#a5d8ff", "width": 164.0625, @@ -1390,7 +1596,7 @@ "frameId": null, "roundness": null, "boundElements": [], - "updated": 1705232213847, + "updated": 1705272385236, "link": null, "locked": false, "fontSize": 20, @@ -1526,9 +1732,9 @@ { "id": "mexveX3hsuycJnV_xFlwn", "type": "text", - "x": 4031.8079506258237, - "y": -11116.279364530052, - "width": 246.09375, + "x": 4219.394331660588, + "y": -11150.082041487154, + "width": 199.21875, "height": 24, "angle": 0, "strokeColor": "#1e1e1e", @@ -1542,29 +1748,29 @@ "frameId": null, "roundness": null, "seed": 1039462229, - "version": 58, - "versionNonce": 77836405, + "version": 135, + "versionNonce": 2041282741, "isDeleted": false, "boundElements": null, - "updated": 1705232180224, + "updated": 1705272532045, "link": null, "locked": false, - "text": "machines-service:3000", + "text": "machines-app:3000", "fontSize": 20, "fontFamily": 3, "textAlign": "left", "verticalAlign": "top", "baseline": 19, "containerId": null, - "originalText": "machines-service:3000", + "originalText": "machines-app:3000", "lineHeight": 1.2 }, { "id": "nWQ6dNawezlmi4uYfgWBy", "type": "text", - "x": 4029.8403639793914, - "y": -10541.40925047032, - "width": 246.09375, + "x": 4316.116079608326, + "y": -10700.817169101681, + "width": 222.65625, "height": 24, "angle": 0, "strokeColor": "#1e1e1e", @@ -1578,21 +1784,186 @@ "frameId": null, "roundness": null, "seed": 1203968507, - "version": 133, - "versionNonce": 1897752853, + "version": 307, + "versionNonce": 1772202133, "isDeleted": false, "boundElements": null, - "updated": 1705232191215, + "updated": 1705272518661, "link": null, "locked": false, - "text": "products-service:3000", + "text": "products-app-1:3000", "fontSize": 20, "fontFamily": 3, "textAlign": "left", "verticalAlign": "top", "baseline": 19, "containerId": null, - "originalText": "products-service:3000", + "originalText": "products-app-1:3000", + "lineHeight": 1.2 + }, + { + "id": "GWChLBYhFI9kdropPUQeG", + "type": "text", + "x": 4153.042614670918, + "y": -10370.13837505832, + "width": 222.65625, + "height": 24, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "cross-hatch", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 2, + "opacity": 60, + "groupIds": [], + "frameId": null, + "roundness": null, + "seed": 1087064533, + "version": 326, + "versionNonce": 1726431547, + "isDeleted": false, + "boundElements": null, + "updated": 1705272524495, + "link": null, + "locked": false, + "text": "products-app-2:3000", + "fontSize": 20, + "fontFamily": 3, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 19, + "containerId": null, + "originalText": "products-app-2:3000", + "lineHeight": 1.2 + }, + { + "id": "12ktETjUSPoRsMJk3PXBy", + "type": "arrow", + "x": 4137.504982923524, + "y": -10821.943638734365, + "width": 400.6504031289887, + "height": 714.2560698272282, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "cross-hatch", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 2, + "opacity": 60, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "seed": 1850086261, + "version": 157, + "versionNonce": 2081212475, + "isDeleted": false, + "boundElements": null, + "updated": 1705272481940, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 400.6504031289887, + 714.2560698272282 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "elementId": "IdWgQ7K35j_LT3pdoxDq0", + "focus": -0.7214192287183446, + "gap": 2.0682815463108 + }, + "endBinding": { + "elementId": "sgmwBqZMfXCJB7d57hCMQ", + "focus": -0.8623062595162034, + "gap": 4.761951908674746 + }, + "startArrowhead": null, + "endArrowhead": "arrow" + }, + { + "id": "MRa2-4EMmdkvVd8S4eA5x", + "type": "text", + "x": 4019.049003102577, + "y": -10924.507953278779, + "width": 105.46875, + "height": 24, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "cross-hatch", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 2, + "opacity": 60, + "groupIds": [], + "frameId": null, + "roundness": null, + "seed": 1901988059, + "version": 72, + "versionNonce": 2141549179, + "isDeleted": false, + "boundElements": null, + "updated": 1705272500062, + "link": null, + "locked": false, + "text": "/machines", + "fontSize": 20, + "fontFamily": 3, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 19, + "containerId": null, + "originalText": "/machines", + "lineHeight": 1.2 + }, + { + "id": "9D7Gw2OyaxH8PvxvmUAw1", + "type": "text", + "x": 4021.137676009853, + "y": -10843.048474889683, + "width": 105.46875, + "height": 24, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "cross-hatch", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 2, + "opacity": 60, + "groupIds": [], + "frameId": null, + "roundness": null, + "seed": 1419857851, + "version": 46, + "versionNonce": 1278607099, + "isDeleted": false, + "boundElements": [ + { + "id": "fz4-v3BbLpHUlDxmoU9oC", + "type": "arrow" + } + ], + "updated": 1705272581652, + "link": null, + "locked": false, + "text": "/products", + "fontSize": 20, + "fontFamily": 3, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 19, + "containerId": null, + "originalText": "/products", "lineHeight": 1.2 } ], diff --git a/products/Dockerfile b/products/Dockerfile index 9e21a5f..fd5bf45 100644 --- a/products/Dockerfile +++ b/products/Dockerfile @@ -1,4 +1,4 @@ -# stage 2: build golang backend +# stage 1: build golang backend FROM golang:1.21-alpine3.19 as go-builder WORKDIR /go-builder @@ -13,8 +13,9 @@ RUN \ # stage 2: build final container FROM alpine:3.19 -USER $USER WORKDIR /app COPY --from=go-builder /go-builder/products-app /app +USER 33 + ENTRYPOINT ["/app/products-app"] diff --git a/proxy/envoy.yaml b/proxy/envoy.yaml index 8747de1..702d0e7 100644 --- a/proxy/envoy.yaml +++ b/proxy/envoy.yaml @@ -55,7 +55,12 @@ static_resources: - endpoint: address: socket_address: - address: products-app + address: products-app-1 + port_value: 3000 + - endpoint: + address: + socket_address: + address: products-app-2 port_value: 3000 admin: access_log_path: "/dev/null"