diff --git a/.dockerignore b/.dockerignore index 029c9e3..6fc6f0f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -37,6 +37,8 @@ build/ # Postgresql Data .postgresql_data/ +postgres +files docker-compose.yaml Dockerfile @@ -49,3 +51,5 @@ node_modules .eslintrc.json .prettierignore .prettierrc +package-lock.json + diff --git a/.eslintrc.json b/.eslintrc.json index 62b8d8e..26b5c86 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,7 +12,7 @@ "prettier" // this rule should be the last ], "overrides": [], - "parser": "@typescript-eslint/parser", + // "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": "latest", "sourceType": "module", diff --git a/Dockerfile.frontend b/Dockerfile.frontend index f067758..7a3daac 100644 --- a/Dockerfile.frontend +++ b/Dockerfile.frontend @@ -1,21 +1,10 @@ -# Stage 1: Build the React application -FROM node:latest as build -WORKDIR /app - -COPY package.json package-lock.json ./ +FROM node:13.12.0-alpine as build +WORKDIR /app +COPY . . RUN npm install -COPY . ./ - -RUN npm run build - -# Stage 2: Serve the React application from Nginx -FROM nginx:alpine - -COPY --from=build /app/build /usr/share/nginx/html - -EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +EXPOSE 3000 +CMD ["npm", "start"] diff --git a/docker-compose.yaml b/docker-compose.yaml index 2bdb057..aae57b0 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,11 +2,38 @@ version: '3.3' networks: network: driver: bridge - name: tracer-network + services: + backend: + build: + context: . + dockerfile: Dockerfile.backend + container_name: tracer-backend + networks: + - network + ports: + - "8080:8080" + env_file: + - env.list + depends_on: + - redis + - postgres + restart: unless-stopped + frontend: + build: + context: . + dockerfile: Dockerfile.frontend + container_name: tracer-frontend + network_mode: host + env_file: + - env.list + ports: + - "3000:3000" + restart: unless-stopped + volumes: + - .:/app - postgres: image: postgres:latest networks: diff --git a/env.list.example b/env.list.example index 528afb3..88522c6 100644 --- a/env.list.example +++ b/env.list.example @@ -20,6 +20,6 @@ GITHUB_CLIENT_SECRET= AWS_BUCKET= AWS_ACCESS= AWS_SECRET= -AWS_URL=http://{ip address of localstack container}:4566 +AWS_URL=http://localstack:4566 AWS_REGION=us-east-1 diff --git a/package-lock.json b/package-lock.json index 2c3c5ab..2d7bfd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "activity-leaderboard", + "name": "tracer-frontend", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "activity-leaderboard", + "name": "tracer-frontend", "version": "0.1.0", "dependencies": { "@reduxjs/toolkit": "^1.9.7", diff --git a/package.json b/package.json index 82e6d0c..a8c715d 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "activity-leaderboard", + "name": "tracer-frontend", "version": "0.1.0", "private": true, "dependencies": { @@ -40,8 +40,7 @@ }, "eslintConfig": { "extends": [ - "react-app", - "react-app/jest" + "react-app" ] }, "browserslist": { diff --git a/src/envConstants.ts b/src/envConstants.ts index 81d836e..c7698d5 100644 --- a/src/envConstants.ts +++ b/src/envConstants.ts @@ -1,6 +1,6 @@ -export const CLIENT_ID = process.env.CLIENT_ID; -export const BACKEND_URL = process.env.BACKEND_URL; -export const AVATAR_API = process.env.AVATAR_API; +export const CLIENT_ID ="149d2857118e05e729a8"; +export const BACKEND_URL = "http://localhost:8080"; +export const AVATAR_API = "w9zrqHdDa4MsYB"; // http://13.233.127.61:8080 // https://leaderboard-java.mdgspace.org \ No newline at end of file