docker: secrets!

This commit is contained in:
Quaternions 2024-12-12 13:12:21 -08:00
parent 4c5d9e420d
commit 55b5516782
2 changed files with 8 additions and 2 deletions

View File

@ -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 . .

View File

@ -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