Skip to content

Commit

Permalink
Fix project layout
Browse files Browse the repository at this point in the history
Closes: #2
  • Loading branch information
Lucas Ramage committed May 12, 2022
1 parent 9a8bc56 commit 0b40f52
Show file tree
Hide file tree
Showing 412 changed files with 26 additions and 4 deletions.
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Mac OS X files
.DS_Store

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/

# Dependency directories (remove the comment below to include it)
# vendor/
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM golang:1.12.8 AS builder
ENV SERVICE_NAME=rancher-catalog-stats
WORKDIR /go/src/github.com/rancherlabs/rancher-catalog-stats/
ADD src .
ADD . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o ${SERVICE_NAME} .

FROM alpine:3.15.4
Expand All @@ -25,12 +25,15 @@ ENV SERVICE_NAME=rancher-catalog-stats \
ENV PATH=${PATH}:${SERVICE_HOME}

WORKDIR $SERVICE_HOME

COPY --from=builder /go/src/github.com/rancherlabs/rancher-catalog-stats/${SERVICE_NAME} ${SERVICE_HOME}
COPY --from=builder /go/src/github.com/rancherlabs/rancher-catalog-stats/GeoLite2-City.mmdb.gz ${SERVICE_HOME}

RUN gzip -d GeoLite2-City.mmdb.gz && \
rm -rf GeoLite2-City.mmdb.gz && \
addgroup -g ${SERVICE_GID} ${SERVICE_GROUP} && \
adduser -g "${SERVICE_NAME} user" -D -h ${SERVICE_HOME} -G ${SERVICE_GROUP} -s /sbin/nologin -u ${SERVICE_UID} ${SERVICE_USER} && \
chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SERVICE_HOME}

USER $SERVICE_USER

File renamed without changes.
2 changes: 1 addition & 1 deletion src/go.mod → go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/rancherlabs/rancher-catalog-stats/src
module github.com/rancherlabs/rancher-catalog-stats

go 1.12

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0b40f52

Please sign in to comment.