Skip to content

Commit

Permalink
Merge pull request #40 from HitomaruKonpaku/master
Browse files Browse the repository at this point in the history
Update README & docker
  • Loading branch information
planetarian authored Nov 12, 2024
2 parents 08f1b73 + 232467d commit 33d826c
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 10 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: docker-build

on:
push:
branches:
- master
# pull_request:
# branches:
# - master

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
type=ref,event=branch
type=ref,event=pr
type=sha
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
platforms: linux/amd64, linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# KanColle Cache Proxy

[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/A0A81MOVN)

This is a local proxy meant to cache KC assets and bypass the gadget IP block. It can be preloaded from a cache dump (linked below). This will improve loading of assets on top of browser built-in cache.

## Installation and setup

See [Installation and setup](https://github.com/Tibowl/KCCacheProxy/wiki/Installation-and-setup) for more information. If you still have problems, try in Chrome with the extension linked there and if you still have, you can ask for help in the [reddit KC discord](https://discord.gg/RtSadWM).

## Docker

### Proxy server

Download [docker-compose.yaml](./docker-compose.yaml) or copy below code

```yaml
---
services:
kccp:
container_name: kccp
image: ghcr.io/hitomarukonpaku/kccacheproxy
restart: unless-stopped
ports:
- 8080:8080
volumes:
- ./data:/data
- ./cache:/cache
```
Open terminal in the same folder with above file then run
```sh
docker compose up -d
```

### Preload

```sh
docker run --rm -v "./cache:/cache" ghcr.io/hitomarukonpaku/kccacheproxy preload
```

### Update image

```sh
docker pull ghcr.io/hitomarukonpaku/kccacheproxy
```
8 changes: 0 additions & 8 deletions ReadMe.md

This file was deleted.

7 changes: 5 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# BASE
FROM node:18-alpine AS base
FROM node:lts-alpine AS base

RUN apk add --no-cache tini

Expand All @@ -10,7 +10,7 @@ COPY package*.json ./
# DEPENDENCIES
FROM base AS dependencies

RUN npm install --no-progress --omit=dev
RUN npm ci --omit=dev

# BUILDER
FROM base AS builder
Expand All @@ -22,6 +22,9 @@ FROM base

ENV DATA_DIR=/data

VOLUME /data
VOLUME /cache

RUN mkdir /data
RUN mkdir /cache

Expand Down

0 comments on commit 33d826c

Please sign in to comment.