Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Commit ce0de9e

Browse files
authored
First Step to Dockerize (#10)
* First Step to Dockerize That's one small step for dockerfile, one giant leap for buildkind. * Review dockerfile Ready to merge Todo: Need to solve the CORS issue * add docker compose * add finally the final dockerization. * add clean up docker section. * small typo
1 parent 2de9f78 commit ce0de9e

19 files changed

+39901
-24004
lines changed

.dockerignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
*.md
2+
/tags
3+
/posts
4+
/users
5+
/votes
6+
/queries
7+
/comments
8+
/node_modules
9+
/app/node_modules/*
10+
/app/client/node_modules/*
11+
**/*.rdf.gz
12+
/p
13+
/w
14+
npm-debug.log
15+
/data
16+
/zw
17+
.DS_Store

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
**/*.rdf.gz
2+
/node_modules/*
23
/p
34
/w
45
npm-debug.log

README.md

+48-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ A blazingly fast Stack Overflow clone running the real Stack Exchange dataset.
66

77
**UPDATE: This project is properly updated to work with version 20.xx.x of Dgraph. It's working as expected on macOS and Linux. There are some problems running the project on Windows, that can be solved by starting JS server and JS client separately. See "syntax_changed.md" for detailed instructions**
88

9-
[Live](https://graphoverflow.dgraph.io)
10-
119
## Running locally
1210

1311
### First Thing first
@@ -28,6 +26,54 @@ it won't work.
2826

2927
> You can also instead of steps 2, 3, and 4, you can just run sh ./run.sh
3028
29+
### Docker Compose
30+
31+
We have a dockerized env so you can run this project.
32+
33+
1. Run Docker-composer
34+
35+
The first build will take time.
36+
```
37+
docker-compose up # In the first time
38+
or
39+
docker-compose up --build # If you wanna rebuild it
40+
```
41+
The compose has a script that will prepare everything for you. You might wait for the deployment to be done and updated the page if so.
42+
43+
2. Now go to localhost:3000 or the IP if you are running docker in a VM.
44+
45+
### If anything goes wrong
46+
47+
If the page loads but keeps showing the animated loader. It means that something goes wrong. You should see a loaded site with empty questions.
48+
49+
>You don't need to do much when running this docker-compose. In general, if you are running docker in a VM the IP is 192.168.99.100 (between 99 and 199, you can check it via docker-machine). In that case, you gonna need to change all addresses in the code from localhost or 127.0.0.1 to the VM IP.
50+
51+
>Paths you might change: \
52+
app/client/src/lib/helpers.js \
53+
app/helpers.js
54+
55+
>Pay attention that this docker-composer will create a volume in your docker env.
56+
57+
>If your docker is binded to localhost. Don't change anything.
58+
59+
### Clean up docker.
60+
61+
```
62+
docker-compose down
63+
or
64+
docker-compose rm
65+
```
66+
and
67+
```
68+
docker stop $(docker ps -a -q)
69+
70+
docker rm $(docker ps -a -q)
71+
72+
docker volume ls
73+
74+
docker volume rm graphoverflow_dgraph
75+
```
76+
3177
### Dgraph
3278

3379
This app is currently compatible with Dgraph v20.xx.x

app/auth.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ export function configPassport(passport) {
9191
passport.use(
9292
new GitHubStrategy(
9393
{
94-
clientID: process.env.GitHubClientID,
95-
clientSecret: process.env.GitHubClientSecret,
94+
clientID: "17819057342d73375cf7", // please add this env var => // process.env.GitHubClientID,
95+
clientSecret: "89617a432f8dc31bb581ec8582e928be15a9685c", // please add this env var => // process.env.GitHubClientSecret,
9696
callbackURL: `${callbackURL}/api/auth/github/callback`
9797
},
9898
(accessToken, refreshToken, profile, cb) => {

0 commit comments

Comments
 (0)