Compare commits
4 Commits
1efa028e37
...
c1ce1a1565
Author | SHA1 | Date | |
---|---|---|---|
c1ce1a1565 | |||
3f7a895593 | |||
7a5018bc5e | |||
1b325169cf |
@ -4,6 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "*"
|
- "*"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
10
Dockerfile
10
Dockerfile
@ -1,5 +1,5 @@
|
|||||||
# Use the official Golang image for building
|
# Use the official Golang image for building
|
||||||
FROM golang:1.23 AS builder
|
FROM golang:1.24 AS builder
|
||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
# Copy Go modules and dependencies
|
# Copy Go modules and dependencies
|
||||||
@ -11,11 +11,15 @@ COPY . .
|
|||||||
RUN go build -o gosearch .
|
RUN go build -o gosearch .
|
||||||
|
|
||||||
# Use a minimal base image for final deployment
|
# Use a minimal base image for final deployment
|
||||||
FROM alpine:latest
|
FROM alpine:3.21
|
||||||
# Set working directory in the container
|
# Set working directory in the container
|
||||||
WORKDIR /root/
|
WORKDIR /
|
||||||
# Copy the built binary from the builder stage
|
# Copy the built binary from the builder stage
|
||||||
COPY --from=builder /app/gosearch .
|
COPY --from=builder /app/gosearch .
|
||||||
|
# Add executing User
|
||||||
|
RUN addgroup gosearch
|
||||||
|
RUN useradd -g gosearch gosearch
|
||||||
|
USER gosearch
|
||||||
# Expose the application port
|
# Expose the application port
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
# Run the application
|
# Run the application
|
||||||
|
Loading…
x
Reference in New Issue
Block a user