Skip to content

Commit 24fc934

Browse files
committed
add deployment section, start as none root user and in production mode
1 parent d59b666 commit 24fc934

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ COPY --from=builder /usr/src/app/node_modules node_modules
1818
COPY --from=builder /usr/src/app/build build
1919
COPY --from=builder /usr/src/app/package.json .
2020

21+
ENV NODE_ENV=production
2122
EXPOSE 3000
2223

24+
USER node
25+
2326
CMD [ "node", "build/index.js" ]
2427

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ docker-compose run k6 run /benchmark/composed-schema.js
6565

6666
Our benchmark suite is running in the CI.
6767

68+
## Deployment
69+
70+
GraphQL-Registry uses by default postgres as database.
71+
72+
```sh
73+
docker run -e DATABASE_URL="" starptech/graphql-registry:latest -p 3000:3000
74+
```
75+
6876
## Contributing
6977

7078
❤️ contributions!

docker-compose.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@ services:
66
container_name: graphql-registry
77
build: .
88
ports:
9-
- "3001:3000"
9+
- '3001:3000'
1010
restart: unless-stopped
1111
environment:
1212
DATABASE_URL: postgresql://postgres:changeme@postgres:5432/graphql-registry?schema=public
13-
profiles:
14-
- test
1513

1614
postgres:
1715
container_name: postgres
1816
image: postgres
1917
healthcheck:
20-
test: ["CMD-SHELL", "pg_isready -U postgres"]
18+
test: ['CMD-SHELL', 'pg_isready -U postgres']
2119
interval: 10s
2220
timeout: 5s
2321
retries: 5
@@ -26,7 +24,7 @@ services:
2624
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
2725
PGDATA: /data/postgres
2826
ports:
29-
- "5440:5432"
27+
- '5440:5432'
3028
restart: unless-stopped
3129

3230
k6:
@@ -39,4 +37,4 @@ services:
3937
volumes:
4038
- ./benchmark:/benchmark
4139
profiles:
42-
- test
40+
- test

0 commit comments

Comments
 (0)