docker: secrets!
This commit is contained in:
parent
4c5d9e420d
commit
55b5516782
@ -1,5 +1,5 @@
|
||||
# Stage 1: Build
|
||||
FROM golang:1.23 AS builder
|
||||
FROM docker.io/golang:1.23 AS builder
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /app
|
||||
@ -8,7 +8,7 @@ WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
# Download dependencies
|
||||
RUN go mod download
|
||||
RUN --mount=type=secret,id=netrc,dst=/root/.netrc go mod download
|
||||
|
||||
# Copy the entire project
|
||||
COPY . .
|
||||
|
@ -3,6 +3,10 @@ networks:
|
||||
maps-service-network:
|
||||
driver: bridge
|
||||
|
||||
secrets:
|
||||
netrc:
|
||||
file: /home/quat/.netrc
|
||||
|
||||
services:
|
||||
nats:
|
||||
image: docker.io/nats:latest
|
||||
@ -15,6 +19,8 @@ services:
|
||||
|
||||
maps-service:
|
||||
build:
|
||||
secrets:
|
||||
- netrc
|
||||
context: .
|
||||
dockerfile: Containerfile
|
||||
container_name: maps-service
|
||||
|
Loading…
Reference in New Issue
Block a user