Skip to content

Commit

Permalink
Merge pull request #1 from fpmortal/dockerize-app
Browse files Browse the repository at this point in the history
Dockerize app
  • Loading branch information
ksdev-pl authored Jul 7, 2024
2 parents bfab40d + f675105 commit 44ab904
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
.DS_Store
4 changes: 4 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:5173 {
root * /usr/share/caddy
file_server
}
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:22-alpine3.19 AS builder

WORKDIR /app

COPY package*.json .

RUN npm install

COPY . .

RUN npm run build

FROM caddy:2.8.4-alpine

COPY Caddyfile /etc/caddy/Caddyfile

COPY --from=builder /app/dist/ /usr/share/caddy/

EXPOSE 5173
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ npm run dev
```sh
npm run build
```

### Run with Docker

```sh
docker compose up # http://localhost:5173
```
5 changes: 5 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
app:
build: "."
ports:
- "5173:5173"

0 comments on commit 44ab904

Please sign in to comment.