feat(docker): adding docker image build support

This commit is contained in:
2025-10-13 09:57:25 +02:00
parent 0a66597018
commit be9f68c38c
6 changed files with 46 additions and 12 deletions

13
docker/Dockerfile.api Normal file
View File

@@ -0,0 +1,13 @@
FROM golang:latest AS builder
ARG CGO_ENABLED=0
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build
FROM scratch
COPY --from=builder /app/realz /realz
ENTRYPOINT ["/realz"]

View File

@@ -7,6 +7,6 @@ RUN apk add --no-cache gdal gdal-tools gdal-driver-PG
# Exposer le port par défaut de PostgreSQL
EXPOSE 5432
COPY scripts/init-db.sh /docker-entrypoint-initdb.d/init-db.sh
COPY data/RAF20_lambert93.tiff /opt/RAF20_lambert93.tiff
COPY docker/scripts/init-db.sh /docker-entrypoint-initdb.d/init-db.sh
COPY docker/data/RAF20_lambert93.tiff /opt/RAF20_lambert93.tiff
RUN chmod +x /docker-entrypoint-initdb.d/init-db.sh

View File

@@ -1,13 +1,4 @@
services:
api:
image: postgrest/postgrest
ports:
- "3300:3000"
environment:
PGRST_DB_URI: postgres://${PGRST_AUTHUSER}:${PGRST_PASSWORD}@postgis:5432
PGRST_DB_SCHEMAS: raf20lambert93
PGRST_DB_ANON_ROLE: web_anon
PGRST_OPENAPI_SERVER_PROXY_URI: http://127.0.0.1:3000
postgis:
image: realz
container_name: postgis_initialized