Skip to content

Commit da090a0

Browse files
Merge remote-tracking branch 'origin/main' into eee-UID2-4863-create-prebid-client-server-sample-page
2 parents ffbcb20 + 54c4fe7 commit da090a0

File tree

28 files changed

+4832
-48
lines changed

28 files changed

+4832
-48
lines changed

.env.sample

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# for local development
2+
# UID2_BASE_URL="http://host.docker.internal:8080"
3+
4+
UID2_BASE_URL="https://operator-integ.uidapi.com"
5+
UID2_CSTG_SERVER_PUBLIC_KEY="UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q=="
6+
UID2_CSTG_SUBSCRIPTION_ID="DMr7uHxqLU"
7+
8+
UID2_API_KEY="your-api-key"
9+
UID2_CLIENT_SECRET="your-client-secret"
10+
UID2_JS_SDK_URL="https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js"
11+
UID2_JS_SDK_NAME="__uid2"

.gitattributes

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Set default behavior to automatically normalize line endings
2+
* text=auto
3+
4+
# Shell scripts should use LF
5+
*.sh text eol=lf
6+
7+
# Docker files should use LF
8+
Dockerfile text eol=lf
9+
docker-compose.yml text eol=lf
10+
11+
# Environment files can use CRLF on Windows
12+
*.env text
13+
env text

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
.idea/
22
.DS_Store
3+
.env
4+
5+
# Node.js
6+
node_modules/
7+
**/node_modules/

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,70 @@ The example applications illustrate the basic steps that you need to consider fo
2222
- Deal with missing identities.
2323
- Handle user opt-outs.
2424

25+
## Docker Compose Setup
26+
27+
This repository includes Docker Compose configuration for easy development and testing of multiple UID2 integration examples.
28+
29+
### Quick Start
30+
31+
**Start all services:**
32+
```bash
33+
docker-compose up -d
34+
```
35+
36+
**Start a single service:**
37+
```bash
38+
# Start only the Prebid.js client-side integration
39+
docker-compose up -d prebid-client
40+
41+
# Start with live logs (foreground)
42+
docker-compose up prebid-client
43+
```
44+
45+
**Stop services:**
46+
```bash
47+
# Stop all services
48+
docker-compose down
49+
50+
# Stop a single service
51+
docker-compose stop prebid-client
52+
```
53+
54+
**View logs:**
55+
```bash
56+
# View all logs
57+
docker-compose logs -f
58+
59+
# View logs for a specific service
60+
docker-compose logs -f prebid-client
61+
```
62+
63+
**Rebuild and restart:**
64+
```bash
65+
# Rebuild and restart all services
66+
docker-compose up -d --build
67+
68+
# Rebuild and restart a single service
69+
docker-compose up -d --build prebid-client
70+
```
71+
72+
### Available Services
73+
74+
- **`prebid-client`** - Prebid.js client-side integration (Port: 3031)
75+
- **`javascript-sdk-client`** - JavaScript SDK client-server integration (Port: 3051)
76+
- *More services will be added as they are containerized*
77+
78+
### Environment Configuration
79+
80+
Edit the `.env` file in the base directory to configure your UID2 settings:
81+
```
82+
# UID2 Configuration for all services
83+
UID2_BASE_URL="http://localhost:8080"
84+
SERVER_PUBLIC_KEY="your-public-key"
85+
SUBSCRIPTION_ID="your-subscription-id"
86+
87+
# Additional variables for client-server example
88+
UID2_API_KEY="your-api-key"
89+
UID2_CLIENT_SECRET="your-client-secret"
90+
```
91+

docker-compose.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
services:
2+
prebid-client:
3+
build:
4+
context: .
5+
dockerfile: web-integrations/prebid-integrations/client-side/Dockerfile
6+
ports:
7+
- "3031:3031"
8+
container_name: prebid-client-side
9+
env_file:
10+
- .env
11+
12+
# Add more services here as needed
13+
javascript-sdk-client-side:
14+
build:
15+
context: .
16+
dockerfile: web-integrations/javascript-sdk/client-side/Dockerfile
17+
ports:
18+
- "3032:3032"
19+
container_name: javascript-sdk-client-side
20+
env_file:
21+
- .env
22+
23+
# google-secure-signals-client:
24+
# build:
25+
# context: .
26+
# dockerfile: web-integrations/google-secure-signals/client-side/Dockerfile
27+
# ports:
28+
# - "3033:3033"
29+
# container_name: google-secure-signals-client
30+
31+
javascript-sdk-client:
32+
build:
33+
context: .
34+
dockerfile: web-integrations/javascript-sdk/client-server/Dockerfile
35+
ports:
36+
- "3051:3051"
37+
container_name: javascript-sdk-client-server
38+
env_file:
39+
- .env

web-integrations/javascript-sdk/client-server/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

web-integrations/javascript-sdk/client-server/.gitkeep

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
FROM node:20.11.0-alpine3.18
22

3+
# Copy entrypoint script
4+
COPY web-integrations/javascript-sdk/client-server/entrypoint.sh /entrypoint.sh
5+
RUN chmod +x /entrypoint.sh
6+
37
WORKDIR /usr/src/app
48

5-
COPY . .
9+
# Copy package files first for better caching
10+
COPY web-integrations/javascript-sdk/client-server/package*.json ./
611
RUN npm install
712

8-
EXPOSE 3000
9-
CMD [ "npm", "start" ]
13+
# Copy application files
14+
COPY web-integrations/javascript-sdk/client-server/server.js ./
15+
COPY web-integrations/javascript-sdk/client-server/public ./public/
16+
COPY web-integrations/javascript-sdk/client-server/views ./views/
17+
18+
EXPOSE 3051
19+
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
# Start the Node.js application
4+
exec npm start

0 commit comments

Comments
 (0)