Skip to content

Commit

Permalink
rfac: docker-compose.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
yp969803 committed Apr 16, 2024
1 parent d89a856 commit 26978d8
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 28 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ build/

# Postgresql Data
.postgresql_data/
postgres
files

docker-compose.yaml
Dockerfile
Expand All @@ -49,3 +51,5 @@ node_modules
.eslintrc.json
.prettierignore
.prettierrc
package-lock.json

2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
21 changes: 5 additions & 16 deletions Dockerfile.frontend
Original file line number Diff line number Diff line change
@@ -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;"]
EXPOSE 3000
CMD ["npm", "start"]
31 changes: 29 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion env.list.example
Original file line number Diff line number Diff line change
Expand Up @@ -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

4 changes: 2 additions & 2 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "activity-leaderboard",
"name": "tracer-frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
Expand Down Expand Up @@ -40,8 +40,7 @@
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
"react-app"
]
},
"browserslist": {
Expand Down
6 changes: 3 additions & 3 deletions src/envConstants.ts
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 26978d8

Please sign in to comment.