Skip to content

Commit

Permalink
refactor: reorganize config locations
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKolarik committed Jan 6, 2025
1 parent 1e8b65a commit 99959d9
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ jobs:
node-version: 20.x
- name: Set up Redis
run: |
docker compose --env-file config/redis/docker.env up -d
cp config/redis/.env.redis ./
docker compose --env-file .env.redis up -d
- name: Build
run: |
npm ci
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ jobs:
docker restart $(docker ps -aq)
- name: Set up Redis
run: |
docker compose --env-file config/redis/docker.env up -d
cp config/redis/.env.redis ./
docker compose --env-file .env.redis up -d
- name: Build
run: |
npm ci
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ probes-stats/all-result.csv
probes-stats/all-result.json
.eslintcache
.env
/.env.redis
File renamed without changes.
14 changes: 12 additions & 2 deletions config/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
```

## Config
### Docker config

See `docker-compose.yml` in the project root and the config files in this directory.
Assuming you start in this directory:

```
cp .env.redis ../../
```

Set the redis password and return to the project root. Then:

```
docker compose --env-file .env.redis up -d
```
14 changes: 7 additions & 7 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
- ./config/redis/standalone.conf:/redis-stack.conf
- ./data/redis/7001:/data
env_file:
- ./config/redis/docker.env
- ./config/redis/.env.redis
redis-standalone-2:
image: redis/redis-stack-server:7.4.0-v1
ports:
Expand All @@ -16,7 +16,7 @@ services:
- ./config/redis/standalone.conf:/redis-stack.conf
- ./data/redis/7002:/data
env_file:
- ./config/redis/docker.env
- ./config/redis/.env.redis
redis-node-01:
image: redis/redis-stack-server:7.4.0-v1
command: [ "bash", "/home/runner/mounted/node.sh", "7101" ]
Expand All @@ -25,7 +25,7 @@ services:
- ./config/redis:/home/runner/mounted
- ./data/redis/7101:/data
env_file:
- ./config/redis/docker.env
- ./config/redis/.env.redis
redis-node-02:
image: redis/redis-stack-server:7.4.0-v1
command: [ "bash", "/home/runner/mounted/node.sh", "7102" ]
Expand All @@ -34,7 +34,7 @@ services:
- ./config/redis:/home/runner/mounted
- ./data/redis/7102:/data
env_file:
- ./config/redis/docker.env
- ./config/redis/.env.redis
redis-node-03:
image: redis/redis-stack-server:7.4.0-v1
command: [ "bash", "/home/runner/mounted/node.sh", "7103" ]
Expand All @@ -43,7 +43,7 @@ services:
- ./config/redis:/home/runner/mounted
- ./data/redis/7103:/data
env_file:
- ./config/redis/docker.env
- ./config/redis/.env.redis
redis-node-04:
image: redis/redis-stack-server:7.4.0-v1
command: [ "bash", "/home/runner/mounted/node.sh", "7104" ]
Expand All @@ -52,7 +52,7 @@ services:
- ./config/redis:/home/runner/mounted
- ./data/redis/7104:/data
env_file:
- ./config/redis/docker.env
- ./config/redis/.env.redis
redis-cluster-creator:
image: redis/redis-stack-server:7.4.0-v1
command: redis-cli -a "$REDIS_PASSWORD" --cluster create $REDIS_PUBLIC_IP:7101 $REDIS_PUBLIC_IP:7102 $REDIS_PUBLIC_IP:7103 $REDIS_PUBLIC_IP:7104 --cluster-replicas 0 --cluster-yes
Expand All @@ -63,7 +63,7 @@ services:
- redis-node-03
- redis-node-04
env_file:
- ./config/redis/docker.env
- ./config/redis/.env.redis

mariadb:
image: mariadb:10.11.5
Expand Down
26 changes: 13 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
- ./config/redis/standalone.conf:/redis-stack.conf
- /data/redis/7001:/data
env_file:
- ./config/redis/docker.env
- ./.env.redis
restart: unless-stopped
stop_grace_period: 2m
redis-standalone-2:
Expand All @@ -18,7 +18,7 @@ services:
- ./config/redis/standalone.conf:/redis-stack.conf
- /data/redis/7002:/data
env_file:
- ./config/redis/docker.env
- ./.env.redis
restart: unless-stopped
stop_grace_period: 2m
redis-node-01:
Expand All @@ -29,7 +29,7 @@ services:
- ./config/redis:/home/runner/mounted
- /data/redis/7101:/data
env_file:
- ./config/redis/docker.env
- ./.env.redis
restart: unless-stopped
stop_grace_period: 2m
redis-node-02:
Expand All @@ -40,7 +40,7 @@ services:
- ./config/redis:/home/runner/mounted
- /data/redis/7102:/data
env_file:
- ./config/redis/docker.env
- ./.env.redis
restart: unless-stopped
stop_grace_period: 2m
redis-node-03:
Expand All @@ -51,7 +51,7 @@ services:
- ./config/redis:/home/runner/mounted
- /data/redis/7103:/data
env_file:
- ./config/redis/docker.env
- ./.env.redis
restart: unless-stopped
stop_grace_period: 2m
redis-node-04:
Expand All @@ -62,7 +62,7 @@ services:
- ./config/redis:/home/runner/mounted
- /data/redis/7104:/data
env_file:
- ./config/redis/docker.env
- ./.env.redis
restart: unless-stopped
stop_grace_period: 2m
redis-node-05:
Expand All @@ -73,7 +73,7 @@ services:
- ./config/redis:/home/runner/mounted
- /data/redis/7105:/data
env_file:
- ./config/redis/docker.env
- ./.env.redis
restart: unless-stopped
stop_grace_period: 2m
redis-node-06:
Expand All @@ -84,7 +84,7 @@ services:
- ./config/redis:/home/runner/mounted
- /data/redis/7106:/data
env_file:
- ./config/redis/docker.env
- ./.env.redis
restart: unless-stopped
stop_grace_period: 2m
redis-node-07:
Expand All @@ -95,7 +95,7 @@ services:
- ./config/redis:/home/runner/mounted
- /data/redis/7107:/data
env_file:
- ./config/redis/docker.env
- ./.env.redis
restart: unless-stopped
stop_grace_period: 2m
redis-node-08:
Expand All @@ -106,7 +106,7 @@ services:
- ./config/redis:/home/runner/mounted
- /data/redis/7108:/data
env_file:
- ./config/redis/docker.env
- ./.env.redis
restart: unless-stopped
stop_grace_period: 2m
redis-node-09:
Expand All @@ -117,7 +117,7 @@ services:
- ./config/redis:/home/runner/mounted
- /data/redis/7109:/data
env_file:
- ./config/redis/docker.env
- ./.env.redis
restart: unless-stopped
stop_grace_period: 2m
redis-node-10:
Expand All @@ -128,7 +128,7 @@ services:
- ./config/redis:/home/runner/mounted
- /data/redis/7110:/data
env_file:
- ./config/redis/docker.env
- ./.env.redis
restart: unless-stopped
stop_grace_period: 2m
redis-cluster-creator:
Expand All @@ -147,4 +147,4 @@ services:
- redis-node-09
- redis-node-10
env_file:
- ./config/redis/docker.env
- ./.env.redis

0 comments on commit 99959d9

Please sign in to comment.