Skip to content

Commit

Permalink
Adds basic container packaging
Browse files Browse the repository at this point in the history
with a sample docker-compose deployment option

Signed-off-by: Yorgos Saslis <yorgos.work@proton.me>
  • Loading branch information
gsaslis committed May 13, 2024
1 parent e06b5cb commit 472561a
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

localhost:80 {
@skip path_regexp \.(wasm|js|css|png|jpe?g|gif|ico|woff2?|otf|ttf|eot|svg|txt|pdf|docx?|xlsx?)$

@static {
file
path *.ico *.css *.js *.gif *.webp *.avif *.jpg *.jpeg *.png *.svg *.woff *.woff2
}
# header @static Cache-Control "public, max-age=259200"
root * /usr/share/caddy
encode zstd gzip
try_files {path} /index.html
file_server
}


15 changes: 15 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:20 as build

WORKDIR /app

COPY . ./
RUN npm install
RUN npm run build


FROM caddy:2.8-alpine

COPY --from=build /app/build /usr/share/caddy



1 change: 1 addition & 0 deletions Dockerfile
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ There are several ways to deploy the UI publicly. Here are two common options:
1. Fork this repository to create your own version
2. Configure your Vercel account to deploy the forked repository

**In a container, using docker-compose:**

1. Use the provided `Containerfile` to build a container image, using, e.g.
`podman build .`
1. Or, if you want to deploy using the provided docker-compose.yaml file,
just run `docker-compose build && docker-compose up`. You should then be
able to open http://localhost:3080 in your favourite browser.

## Contributing

Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.8'

services:
caddy:
build:
dockerfile: ./Containerfile
context: .
ports:
- "3080:80"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data

volumes:
caddy_data:

0 comments on commit 472561a

Please sign in to comment.