From 40ac5580fa91beb98c66fa905624cff6160f7532 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Fri, 24 Feb 2023 20:50:01 +0100 Subject: [PATCH] Docker image bump --- Dockerfile | 4 +--- example/main.go | 33 --------------------------------- 2 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 example/main.go diff --git a/Dockerfile b/Dockerfile index 3d43957..7ce339a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,6 @@ # === BUILD STAGE === # FROM golang:1.12-alpine as build -ARG ACCESS_TOKEN - RUN apk add --no-cache git WORKDIR /srv/app @@ -16,7 +14,7 @@ RUN go test -v ./... RUN go build -ldflags="-w -s" -o build # === RUN STAGE === # -FROM alpine as run +FROM registry.odit.services/hub/library/alpine:3.16 as run RUN apk update \ && apk upgrade \ diff --git a/example/main.go b/example/main.go deleted file mode 100644 index ff261c2..0000000 --- a/example/main.go +++ /dev/null @@ -1,33 +0,0 @@ -package main - -import ( - "net/http" - "time" - - npmproxy "github.com/pkgems/npm-cache-proxy/proxy" - "github.com/go-redis/redis" -) - -func main() { - proxy := npmproxy.Proxy{ - Database: npmproxy.DatabaseRedis{ - Client: redis.NewClient(&redis.Options{ - Addr: "localhost:6379", - DB: 0, - Password: "", - }), - }, - HttpClient: &http.Client{}, - } - - proxy.Server(npmproxy.ServerOptions{ - ListenAddress: "localhost:8080", - GetOptions: func() (npmproxy.Options, error) { - return npmproxy.Options{ - DatabasePrefix: "ncp-", - DatabaseExpiration: 1 * time.Hour, - UpstreamAddress: "https://registry.npmjs.org", - }, nil - }, - }).ListenAndServe() -}