Skip to content

Commit 26978d8

Browse files
committed
rfac: docker-compose.yaml
1 parent d89a856 commit 26978d8

File tree

8 files changed

+47
-28
lines changed

8 files changed

+47
-28
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ build/
3737

3838
# Postgresql Data
3939
.postgresql_data/
40+
postgres
41+
files
4042

4143
docker-compose.yaml
4244
Dockerfile
@@ -49,3 +51,5 @@ node_modules
4951
.eslintrc.json
5052
.prettierignore
5153
.prettierrc
54+
package-lock.json
55+

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"prettier" // this rule should be the last
1313
],
1414
"overrides": [],
15-
"parser": "@typescript-eslint/parser",
15+
// "parser": "@typescript-eslint/parser",
1616
"parserOptions": {
1717
"ecmaVersion": "latest",
1818
"sourceType": "module",

Dockerfile.frontend

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
1-
# Stage 1: Build the React application
2-
FROM node:latest as build
31

4-
WORKDIR /app
5-
6-
COPY package.json package-lock.json ./
72

3+
FROM node:13.12.0-alpine as build
4+
WORKDIR /app
5+
COPY . .
86
RUN npm install
97

10-
COPY . ./
11-
12-
RUN npm run build
13-
14-
# Stage 2: Serve the React application from Nginx
15-
FROM nginx:alpine
16-
17-
COPY --from=build /app/build /usr/share/nginx/html
18-
19-
EXPOSE 80
208

21-
CMD ["nginx", "-g", "daemon off;"]
9+
EXPOSE 3000
10+
CMD ["npm", "start"]

docker-compose.yaml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,38 @@ version: '3.3'
22
networks:
33
network:
44
driver: bridge
5-
name: tracer-network
5+
66
services:
7+
backend:
8+
build:
9+
context: .
10+
dockerfile: Dockerfile.backend
11+
container_name: tracer-backend
12+
networks:
13+
- network
14+
ports:
15+
- "8080:8080"
16+
env_file:
17+
- env.list
18+
depends_on:
19+
- redis
20+
- postgres
21+
restart: unless-stopped
722

23+
frontend:
24+
build:
25+
context: .
26+
dockerfile: Dockerfile.frontend
27+
container_name: tracer-frontend
28+
network_mode: host
29+
env_file:
30+
- env.list
31+
ports:
32+
- "3000:3000"
33+
restart: unless-stopped
34+
volumes:
35+
- .:/app
836

9-
1037
postgres:
1138
image: postgres:latest
1239
networks:

env.list.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ GITHUB_CLIENT_SECRET=
2020
AWS_BUCKET=
2121
AWS_ACCESS=
2222
AWS_SECRET=
23-
AWS_URL=http://{ip address of localstack container}:4566
23+
AWS_URL=http://localstack:4566
2424
AWS_REGION=us-east-1
2525

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "activity-leaderboard",
2+
"name": "tracer-frontend",
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
@@ -40,8 +40,7 @@
4040
},
4141
"eslintConfig": {
4242
"extends": [
43-
"react-app",
44-
"react-app/jest"
43+
"react-app"
4544
]
4645
},
4746
"browserslist": {

src/envConstants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
export const CLIENT_ID = process.env.CLIENT_ID;
2-
export const BACKEND_URL = process.env.BACKEND_URL;
3-
export const AVATAR_API = process.env.AVATAR_API;
1+
export const CLIENT_ID ="149d2857118e05e729a8";
2+
export const BACKEND_URL = "http://localhost:8080";
3+
export const AVATAR_API = "w9zrqHdDa4MsYB";
44

55
// http://13.233.127.61:8080
66
// https://leaderboard-java.mdgspace.org

0 commit comments

Comments
 (0)