Skip to content

Commit c3a6719

Browse files
authored
feat: Restrict docker compose port bindings to 127.0.0.1 (#875)
1 parent 7031c74 commit c3a6719

9 files changed

Lines changed: 15 additions & 8 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@baseplate-dev/core-generators': patch
3+
---
4+
5+
Restrict docker compose port bindings to 127.0.0.1 to prevent exposing development services to the local network

examples/blog-with-auth/apps/admin/src/gql/graphql.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ export type UpdateUserData = {
467467
email?: InputMaybe<Scalars['String']['input']>;
468468
emailVerified?: InputMaybe<Scalars['Boolean']['input']>;
469469
name?: InputMaybe<Scalars['String']['input']>;
470+
phone?: InputMaybe<Scalars['String']['input']>;
470471
};
471472

472473
/** Input type for updateUser mutation */

examples/blog-with-auth/apps/backend/schema.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ input UpdateUserData {
304304
email: String
305305
emailVerified: Boolean
306306
name: String
307+
phone: String
307308
}
308309

309310
"""Input type for updateUser mutation"""

examples/blog-with-auth/baseplate/generated/docker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
POSTGRES_DB: ${POSTGRES_DB:-blog-with-auth}
1111
POSTGRES_INITDB_ARGS: '--encoding=UTF8 --locale=en_US.utf8'
1212
ports:
13-
- '${POSTGRES_PORT:-5432}:5432'
13+
- '127.0.0.1:${POSTGRES_PORT:-5432}:5432'
1414
volumes:
1515
- db-data:/var/lib/postgresql
1616
networks:

examples/blog-with-auth/docker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
POSTGRES_DB: ${POSTGRES_DB:-blog-with-auth}
1111
POSTGRES_INITDB_ARGS: '--encoding=UTF8 --locale=en_US.utf8'
1212
ports:
13-
- '${POSTGRES_PORT:-5432}:5432'
13+
- '127.0.0.1:${POSTGRES_PORT:-5432}:5432'
1414
volumes:
1515
- db-data:/var/lib/postgresql
1616
networks:

examples/todo-with-better-auth/baseplate/generated/docker/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
POSTGRES_DB: ${POSTGRES_DB:-todo-with-better-auth}
1111
POSTGRES_INITDB_ARGS: '--encoding=UTF8 --locale=en_US.utf8'
1212
ports:
13-
- '${POSTGRES_PORT:-6432}:5432'
13+
- '127.0.0.1:${POSTGRES_PORT:-6432}:5432'
1414
volumes:
1515
- db-data:/var/lib/postgresql
1616
networks:
@@ -37,7 +37,7 @@ services:
3737
security_opt:
3838
- no-new-privileges:true
3939
ports:
40-
- '${REDIS_PORT:-6379}:6379'
40+
- '127.0.0.1:${REDIS_PORT:-6379}:6379'
4141
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD:-todo-with-better-auth-password} --maxmemory 256mb --maxmemory-policy noeviction
4242
volumes:
4343
- redis-cache:/data

examples/todo-with-better-auth/docker/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
POSTGRES_DB: ${POSTGRES_DB:-todo-with-better-auth}
1111
POSTGRES_INITDB_ARGS: '--encoding=UTF8 --locale=en_US.utf8'
1212
ports:
13-
- '${POSTGRES_PORT:-6432}:5432'
13+
- '127.0.0.1:${POSTGRES_PORT:-6432}:5432'
1414
volumes:
1515
- db-data:/var/lib/postgresql
1616
networks:
@@ -37,7 +37,7 @@ services:
3737
security_opt:
3838
- no-new-privileges:true
3939
ports:
40-
- '${REDIS_PORT:-6379}:6379'
40+
- '127.0.0.1:${REDIS_PORT:-6379}:6379'
4141
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD:-todo-with-better-auth-password} --maxmemory 256mb --maxmemory-policy noeviction
4242
volumes:
4343
- redis-cache:/data

packages/core-generators/src/generators/docker/docker-compose/postgres.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function generatePostgresDockerCompose(
2323
POSTGRES_DB: \${POSTGRES_DB:-${config.database}}
2424
POSTGRES_INITDB_ARGS: '--encoding=UTF8 --locale=en_US.utf8'
2525
ports:
26-
- "\${POSTGRES_PORT:-${config.port}}:5432"
26+
- "127.0.0.1:\${POSTGRES_PORT:-${config.port}}:5432"
2727
volumes:
2828
- db-data:/var/lib/postgresql
2929
networks:

packages/core-generators/src/generators/docker/docker-compose/redis.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function generateRedisDockerCompose(
1818
security_opt:
1919
- no-new-privileges:true
2020
ports:
21-
- "\${REDIS_PORT:-${config.port}}:6379"
21+
- "127.0.0.1:\${REDIS_PORT:-${config.port}}:6379"
2222
command: redis-server --save 20 1 --loglevel warning --requirepass \${REDIS_PASSWORD:-${config.password}} --maxmemory 256mb --maxmemory-policy noeviction
2323
volumes:
2424
- redis-cache:/data

0 commit comments

Comments
 (0)