Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic container packaging #9

Merged
merged 6 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
localhost:80 {
root * /usr/share/caddy
try_files {path} /index.html
file_server
#header @static Cache-Control "public, max-age=259200"
#encode zstd gzip
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no reason not to enable gzip compression.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary in a local-first, dev env?

#@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
#}
}
26 changes: 26 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:20 AS build

WORKDIR /app

ARG FALLBACK_PUBLIC_EXPLORER
ARG DEFAULT_LOCAL_HTTPD_PORT
ARG PLUGINS_RADICLE_PLANNING_BOARDS_ORIGIN

# copy project file
COPY package.json package-lock.json ./
COPY ./scripts ./scripts
COPY ./public ./public

# install all deps (vite is needed when building, which is a dev dependency)
RUN npm install

COPY . ./
RUN npm run build


FROM caddy:2.8-alpine

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



1 change: 1 addition & 0 deletions Dockerfile
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ 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.


## Configuration

There's two ways to configure the UI:
Expand Down
21 changes: 21 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3.8'

services:
radicle-explorer-with-boards:
image: quay.io/radicle_in_containers/radicle-explorer-with-boards
container_name: radicle-explorer-with-boards
build:
dockerfile: ./Containerfile
context: .
args:
FALLBACK_PUBLIC_EXPLORER: http://localhost:3080/nodes/$host/$rid$path
DEFAULT_LOCAL_HTTPD_PORT: 3080
PLUGINS_RADICLE_PLANNING_BOARDS_ORIGIN: http://localhost:3090
ports:
- "3080:80"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- explorer_caddy_data:/data

volumes:
explorer_caddy_data:
Loading