Skip to content

Commit

Permalink
add frontend dockerfile , fix paths in docker compose yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nickkatsios committed Jan 11, 2024
1 parent 2f904fe commit 23de715
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DB_HOST=db
DB_PORT=3306
DB_USER=root
DB_PASS=mypass
DB_NAME=Arb
MYSQL_ROOT_PASSWORD=mypass
DB_HOST_DOCKER=db
DB_PASS_DOCKER=mydockerdbpass
GMAIL_CRED=mygmailcred
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
15 changes: 11 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ version: '3.8'
services:
scrappers:
build:
context: .
context: ./scrappers
dockerfile: Dockerfile
depends_on:
- db
ports:
- "5000:5000" # Port 5000 on host to port 5000 on container
volumes:
- ./logs:/app/logs # Mount logs directory for persistence
- ./scrappers:/app # Mount scrappers directory for persistence
env_file:
- .env # Add environment variables from file
environment:
Expand All @@ -22,26 +22,33 @@ services:
- DB_PASS=${DB_PASS}
- DB_NAME=${DB_NAME}
# Add email credentials for notifier?
- GMAIL_CRED=${GMAIL_CRED}

db:
image: mysql:8.0.35
command: --default-authentication-plugin=mysql_native_password
volumes:
# Mount SQL scripts for database initialization
- ./init_sql_scripts:/docker-entrypoint-initdb.d
- .db/sql/init_sql_scripts:/docker-entrypoint-initdb.d
env_file:
- .env # Add environment variables from file
ports:
- "3307:3306" # Port 3307 on host to port 3306 on container
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}

redis:
image: redis:alpine
ports:
- "6379:6379" # Port 6379 on host to port 6379 on container

backend:
build:
context: ./backend
dockerfile: Dockerfile
depends_on:
- db
- redis
ports:
- "8000:8000" # Port 8000 on host to port 8000 on container
volumes:
Expand All @@ -62,7 +69,7 @@ services:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000" # Port 3000 on host to port 3000 on container
- "5173:5173" # Port 5173 on host to port 5173 on container
volumes:
- ./frontend:/app # Mount frontend directory for persistence
env_file:
Expand Down
13 changes: 13 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:lts-alpine

WORKDIR /frontend

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 5173

CMD ["npm", "run" , "dev"]

0 comments on commit 23de715

Please sign in to comment.