Skip to content

Commit

Permalink
Add Docker and docker-compoese
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuflatland-lf committed Jul 3, 2024
1 parent 5903e3e commit 8f9c91b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ Tinder like Flashcard App
# Environment
## frontend
- React
- Vite
- Vite

# Run Locally
```
docker compose up --build
```
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3.8'

services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
volumes:
- ./frontend:/app
- node_modules_volume:/app/node_modules
command: sh -c "pnpm run start"
ports:
- "5173:5173"
environment:
- CHOKIDAR_USEPOLLING=true
- NODE_ENV=development
volumes:
node_modules_volume:
14 changes: 14 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Use official Node.js image as the base image
FROM node:20.13.1

# Set the working directory
WORKDIR /app

# Copy package.json and pnpm-lock.yaml files
COPY package.json pnpm-lock.yaml ./

# Install pnpm
RUN npm install -g pnpm

# Install dependencies
RUN pnpm install
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"start": "vite --host",
"build": "tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
Expand Down

0 comments on commit 8f9c91b

Please sign in to comment.