Skip to content

Commit b5a734a

Browse files
authored
Merge pull request #125 from Project-CARPI/package-consistency
Docker Setup
2 parents a9d8c6c + 4379ad1 commit b5a734a

5 files changed

Lines changed: 65 additions & 4 deletions

File tree

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
dist
3+
build
4+
.git
5+
.env
6+
docker-compose.yml
7+
Dockerfile

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM node:24.14.0-alpine
2+
3+
WORKDIR /app
4+
COPY package*.json ./
5+
RUN npm ci
6+
COPY . .
7+
EXPOSE 5173
8+
9+
CMD ["npm", "run", "dev"]

README.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ node -v
5050
npm -v
5151
```
5252

53-
### Installation
53+
If you plan to use Docker, ensure you have [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed.
54+
55+
### Local Installation
5456

5557
1. Clone the repository and navigate into the project directory:
5658

@@ -74,10 +76,35 @@ npm run dev
7476

7577
By default, Vite serves the app on localhost (usually `http://localhost:5173`).
7678

77-
To expose the app on your local network:
79+
### Docker Installation
80+
81+
If you prefer an isolated containerized environment, you can use our Docker Compose setup.
82+
83+
1. Clone the repository and navigate into the project directory:
84+
85+
```bash
86+
git clone https://github.com/Project-CARPI/site.git
87+
cd site
88+
```
89+
90+
2. Build the image and spin up the container:
91+
92+
```bash
93+
docker compose up --build
94+
```
95+
96+
To run the container in detached mode (in the background), append the -d flag:
97+
98+
```bash
99+
docker compose up -d
100+
```
101+
102+
The app will now be accessible at `http://localhost:5173` (or the port specified in your docker compose configuration).
103+
104+
To stop the container, run:
78105

79106
```bash
80-
npm run dev -- --host
107+
docker compose down
81108
```
82109

83110
### Available Scripts
@@ -137,6 +164,7 @@ npm run preview
137164
- [@dnd-kit](https://dndkit.com/)
138165
- [Framer Motion](https://www.framer.com/motion/)
139166
- [Zod](https://zod.dev/)
167+
- [Docker](https://www.docker.com/)
140168

141169
## Contributing
142170

docker-compose.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
services:
2+
web:
3+
build: .
4+
image: carpi-dev:latest
5+
6+
# expose port 5173
7+
ports:
8+
- "5173:5173"
9+
10+
# mount the current directory to /app in the container
11+
volumes:
12+
- .:/app
13+
- /app/node_modules
14+
15+
# interactive terminal
16+
stdin_open: true
17+
tty: true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"npm": "~11.12.0"
99
},
1010
"scripts": {
11-
"dev": "vite",
11+
"dev": "vite --host",
1212
"build": "tsc -b && vite build",
1313
"lint": "eslint .",
1414
"preview": "vite preview",

0 commit comments

Comments
 (0)