Skip to content

Commit 877d646

Browse files
committed
complete movies/models package
1 parent 63ca1df commit 877d646

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

movies/.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Helm chart folder
2+
chart
3+
4+
# Git repo
5+
.git

movies/.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
###Go###
2+
3+
# Compiled Object files, Static and Dynamic libs (Shared Objects)
4+
*.o
5+
*.a
6+
*.so
7+
8+
# Folders
9+
_obj
10+
_test
11+
12+
# Architecture specific extensions/prefixes
13+
*.[568vq]
14+
[568vq].out
15+
16+
*.cgo1.go
17+
*.cgo2.c
18+
_cgo_defun.c
19+
_cgo_gotypes.go
20+
_cgo_export.*
21+
22+
_testmain.go
23+
24+
*.exe
25+
*.test
26+
*.prof
27+
28+
# Helm chart folder
29+
chart

movies/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# base image
2+
FROM golang:1.22.5-alpine AS builder
3+
RUN adduser -D -g '' elf
4+
WORKDIR /opt/app/
5+
COPY go.mod go.sum ./
6+
RUN go mod download && \
7+
go mod verify
8+
COPY . .
9+
10+
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o /go/bin/cinema-movies ./cmd/app
11+
12+
# build a small image
13+
FROM alpine:3.17.3
14+
LABEL language="golang"
15+
LABEL org.opencontainers.image.source https://github.com/mikebellcoder/microservices-docker-go-mongodb
16+
COPY --from=builder /etc/passwd /etc/passwd
17+
COPY --from=builder --chown=elf:1000 /go/bin/cinema-movies /cinema
18+
USER elf
19+
ENTRYPOINT ["./cinema-movies"]

0 commit comments

Comments
 (0)