Skip to content

Commit 5bdc96c

Browse files
committed
better docker management
1 parent 04c80f3 commit 5bdc96c

File tree

6 files changed

+107
-7
lines changed

6 files changed

+107
-7
lines changed

web-integrations/prebid-integrations/client-side/.env.sample renamed to .env.sample

File renamed without changes.

.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

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,64 @@ 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+
- *More services will be added as they are containerized*
76+
77+
### Environment Configuration
78+
79+
Edit the `.env` file in the base directory to configure your UID2 settings:
80+
```
81+
UID2_BASE_URL="http://localhost:8080"
82+
SERVER_PUBLIC_KEY="your-public-key"
83+
SUBSCRIPTION_ID="your-subscription-id"
84+
```
85+

docker-compose.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: '3.8'
2+
3+
services:
4+
prebid-client:
5+
build:
6+
context: .
7+
dockerfile: web-integrations/prebid-integrations/client-side/Dockerfile
8+
ports:
9+
- "3031:3031"
10+
container_name: prebid-client-side
11+
12+
# Add more services here as needed
13+
# google-secure-signals-client:
14+
# build:
15+
# context: .
16+
# dockerfile: web-integrations/google-secure-signals/client-side/Dockerfile
17+
# ports:
18+
# - "3032:3032"
19+
# container_name: google-secure-signals-client
20+
21+
# javascript-sdk-client:
22+
# build:
23+
# context: .
24+
# dockerfile: web-integrations/javascript-sdk/client-side/Dockerfile
25+
# ports:
26+
# - "3033:3033"
27+
# container_name: javascript-sdk-client

web-integrations/prebid-integrations/client-side/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ RUN apk add --no-cache gettext
66
# Copy the env file
77
COPY .env /tmp/env
88

9-
# Copy static files
10-
COPY app.css /usr/share/nginx/html/
11-
COPY prebid.js /usr/share/nginx/html/
9+
# Copy static files from client-side directory
10+
COPY web-integrations/prebid-integrations/client-side/app.css /usr/share/nginx/html/
11+
COPY web-integrations/prebid-integrations/client-side/prebid.js /usr/share/nginx/html/
1212

1313
# Copy config and HTML
14-
COPY default.conf /etc/nginx/conf.d/default.conf
15-
COPY index.html /usr/share/nginx/html/index.template.html
16-
COPY entrypoint.sh /entrypoint.sh
14+
COPY web-integrations/prebid-integrations/client-side/default.conf /etc/nginx/conf.d/default.conf
15+
COPY web-integrations/prebid-integrations/client-side/index.html /usr/share/nginx/html/index.template.html
16+
COPY web-integrations/prebid-integrations/client-side/entrypoint.sh /entrypoint.sh
1717

1818
RUN chmod +x /entrypoint.sh
1919

web-integrations/prebid-integrations/client-side/entrypoint.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export SUBSCRIPTION_ID=${SUBSCRIPTION_ID:-"DMr7uHxqLU"}
1111
# Copy static files
1212
cp /usr/share/nginx/html/app.css /usr/share/nginx/html/
1313
cp /usr/share/nginx/html/prebid.js /usr/share/nginx/html/
14-
cp /usr/share/nginx/html/config.js /usr/share/nginx/html/
1514

1615
# Process index.html template with environment variables
1716
envsubst < /usr/share/nginx/html/index.template.html > /usr/share/nginx/html/index.html

0 commit comments

Comments
 (0)