Skip to content
This repository was archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #34 from alainlep/docker-compose-improvements
Browse files Browse the repository at this point in the history
Docker compose improvements
  • Loading branch information
johnymontana authored Nov 6, 2019
2 parents 20e709b + b30d327 commit 8a9a5cc
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 22 deletions.
1 change: 1 addition & 0 deletions api/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ COPY package.json .
RUN npm install
COPY . .

EXPOSE 4000
EXPOSE 4001

CMD ["npm", "start"]
12 changes: 11 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ services:
api:
build: ./api
ports:
- 4000:4000
- 4001:4001
environment:
- NEO4J_URI=bolt://neo4j:7687
- NEO4J_USER=neo4j
- NEO4J_PASSWORD=letmein
- GRAPHQL_LISTEN_PORT=4001
- GRAPHQL_URI=http://api:4001/graphql

links:
- neo4j
depends_on:
Expand All @@ -26,6 +33,9 @@ services:
build: ./ui
ports:
- 3000:3000
environment:
- REACT_APP_GRAPHQL_URI=/graphql
- PROXY=http://api:4001/graphql
links:
- api
depends_on:
Expand Down
1 change: 1 addition & 0 deletions ui/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
3 changes: 2 additions & 1 deletion ui/.env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
REACT_APP_GRAPHQL_URI=http://localhost:4001/graphql
REACT_APP_GRAPHQL_URI=/graphql
PROXY=http://localhost:4001/graphql
122 changes: 103 additions & 19 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"now-build": "react-scripts build"
},
"devDependencies": {
"http-proxy-middleware": "^0.20.0",
"husky": "^2.7.0",
"lint-staged": "^8.2.1"
},
Expand Down
11 changes: 11 additions & 0 deletions ui/src/setupProxy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const proxy = require("http-proxy-middleware");

module.exports = function(app) {
app.use(
"/graphql",
proxy({
target: `${process.env.PROXY}`,
changeOrigin: true
})
);
};

0 comments on commit 8a9a5cc

Please sign in to comment.