Skip to content

Commit b5a00ec

Browse files
committed
Cleanup
1 parent 360f700 commit b5a00ec

File tree

3 files changed

+26
-40
lines changed

3 files changed

+26
-40
lines changed

deployment/docker-compose.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
version: "3.7"
22
services:
3-
frontend:
4-
container_name: frontend
3+
canvas-frontend:
4+
container_name: canvas-frontend
55
image: ghcr.io/pixelcorp-nl/canvas.edu/canvas.edu
66
restart: unless-stopped
77
ports:
88
- 80:5173
99
env_file:
1010
- .env
1111
depends_on:
12-
- redis
13-
- postgres
14-
- datadog-agent
12+
- canvas-redis
13+
- canvas-postgres
14+
- canvas-datadog-agent
1515

16-
postgres:
17-
container_name: postgres
16+
canvas-postgres:
17+
container_name: canvas-postgres
1818
restart: unless-stopped
19-
image: postgres:alpine
19+
image: postgres:17.2-alpine3.21
2020
environment:
2121
POSTGRES_PASSWORD: postgres
2222
ports:
2323
- 5432:5432
2424
volumes:
2525
- ./postgres-db:/var/lib/postgresql/data
2626

27-
redis:
28-
container_name: redis
29-
image: redis:alpine
27+
canvas-redis:
28+
container_name: canvas-redis
29+
image: redis:7.4.2-alpine
3030
restart: unless-stopped
3131
volumes:
3232
- ./redis-db:/data
3333

34-
datadog-agent:
35-
container_name: datadog-agent
34+
canvas-datadog-agent:
35+
container_name: canvas-datadog-agent
3636
image: gcr.io/datadoghq/agent:latest
3737
pid: host
3838
volumes:
@@ -45,14 +45,14 @@ services:
4545
ports:
4646
- 8125:8125/udp
4747

48-
cloudflared:
49-
container_name: cloudflared
48+
canvas-cloudflared:
49+
container_name: canvas-cloudflared
5050
image: cloudflare/cloudflared
5151
restart: unless-stopped
5252
command: tunnel --no-autoupdate run --token <token>
5353

54-
watchtower:
55-
container_name: watchtower
54+
canvas-watchtower:
55+
container_name: canvas-watchtower
5656
image: containrrr/watchtower
5757
restart: unless-stopped
5858
volumes:

frontend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ FROM node:18-alpine AS main
1616
ENV NODE_ENV=production
1717
ENV PORT=5173
1818
WORKDIR /app
19-
HEALTHCHECK --interval=5s --timeout=1s --start-period=1s --retries=3 CMD wget -q -O - http://127.0.0.1:5173/health
19+
HEALTHCHECK --timeout=1s --start-period=1s --retries=3 CMD wget -q -O - http://127.0.0.1:5173/health
2020

2121
COPY --from=builder-main /app/package.json ./package.json
2222
# COPY --from=builder-main /app/node_modules ./node_modules

tests/js_example.js

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
// Run with node js_example.js
22

3-
// Define the URL of the API endpoint and the request headers
4-
const url = "http://pixelcorp.nl/api/single";
3+
const url = 'https://pixelcorp.nl/api/single';
54
const headers = { 'Content-Type': 'application/json' };
65

7-
// Define the pixel data as a JavaScript object
8-
const pixel = { x: 42, y: 42, color: [255, 25, 0] };
6+
const pixel = { x: 42, y: 42, color: [255, 25, 0], key: 'joppe' };
97

10-
// Send a POST request to the API endpoint with the pixel data as JSON
118
fetch(url, {
12-
method: 'POST',
13-
headers: headers,
14-
body: JSON.stringify(pixel)
15-
})
16-
.then(response => {
17-
// Check if the request was successful
18-
if (response.ok) {
19-
// If the request was successful, print a success message
20-
console.log("Pixel successfully changed!");
21-
} else {
22-
// If the request was unsuccessful, print an error message that includes the HTTP status code
23-
console.log("Failed to change pixel:", response.status);
24-
}
25-
})
26-
.catch(error => {
27-
console.log("Error:", error);
28-
});
9+
method: 'POST',
10+
headers: headers,
11+
body: JSON.stringify(pixel),
12+
}).then((response) => {
13+
response.text().then((text) => console.log(text));
14+
});

0 commit comments

Comments
 (0)