feat(docker): adding docker image build support
This commit is contained in:
28
Taskfile.yml
Normal file
28
Taskfile.yml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
vars:
|
||||||
|
API_IMAGE_NAME: realz
|
||||||
|
API_IMAGE_VERSION: v1.0.0
|
||||||
|
DB_IMAGE_NAME: realzdb
|
||||||
|
DB_IMAGE_VERSION: v1.0.0
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
default:
|
||||||
|
deps: [ build ]
|
||||||
|
silent: true
|
||||||
|
|
||||||
|
build-api:
|
||||||
|
desc: Construction de l'image Docker realz API
|
||||||
|
cmds:
|
||||||
|
- docker build -t {{.API_IMAGE_NAME}}:{{.API_IMAGE_VERSION}} -t {{.API_IMAGE_NAME}}:latest -f docker/Dockerfile.api .
|
||||||
|
silent: true
|
||||||
|
|
||||||
|
build-db:
|
||||||
|
desc: Construction de l'image Docker realz DB
|
||||||
|
cmds:
|
||||||
|
- docker build -t {{.DB_IMAGE_NAME}}:{{.DB_IMAGE_VERSION}} -t {{.DB_IMAGE_NAME}}:latest -f docker/Dockerfile.db .
|
||||||
|
silent: true
|
||||||
|
|
||||||
|
build:
|
||||||
|
desc: Construction des images Docker realz
|
||||||
|
deps: [ build-api, build-db ]
|
@@ -1,5 +1,5 @@
|
|||||||
server:
|
server:
|
||||||
address: "0.0.0.0:8080"
|
address: "0.0.0.0:8088"
|
||||||
|
|
||||||
database:
|
database:
|
||||||
user: "realz"
|
user: "realz"
|
||||||
|
13
docker/Dockerfile.api
Normal file
13
docker/Dockerfile.api
Normal 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"]
|
@@ -7,6 +7,6 @@ RUN apk add --no-cache gdal gdal-tools gdal-driver-PG
|
|||||||
# Exposer le port par défaut de PostgreSQL
|
# Exposer le port par défaut de PostgreSQL
|
||||||
EXPOSE 5432
|
EXPOSE 5432
|
||||||
|
|
||||||
COPY scripts/init-db.sh /docker-entrypoint-initdb.d/init-db.sh
|
COPY docker/scripts/init-db.sh /docker-entrypoint-initdb.d/init-db.sh
|
||||||
COPY data/RAF20_lambert93.tiff /opt/RAF20_lambert93.tiff
|
COPY docker/data/RAF20_lambert93.tiff /opt/RAF20_lambert93.tiff
|
||||||
RUN chmod +x /docker-entrypoint-initdb.d/init-db.sh
|
RUN chmod +x /docker-entrypoint-initdb.d/init-db.sh
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
services:
|
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:
|
postgis:
|
||||||
image: realz
|
image: realz
|
||||||
container_name: postgis_initialized
|
container_name: postgis_initialized
|
||||||
|
@@ -62,6 +62,7 @@
|
|||||||
<select id="srcProj" name="srcProj" required>
|
<select id="srcProj" name="srcProj" required>
|
||||||
<option value="4326" selected>WGS 84 (GPS)</option>
|
<option value="4326" selected>WGS 84 (GPS)</option>
|
||||||
<option value="2154">RGF93 / Lambert-93 (France)</option>
|
<option value="2154">RGF93 / Lambert-93 (France)</option>
|
||||||
|
<option value="3947">RGF93 / CC47 (France)</option>
|
||||||
<option value="3857">WGS 84 / Pseudo-Mercator (Web)</option>
|
<option value="3857">WGS 84 / Pseudo-Mercator (Web)</option>
|
||||||
<option value="4258">ETRS89 (Europe)</option>
|
<option value="4258">ETRS89 (Europe)</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -70,6 +71,7 @@
|
|||||||
<label for="dstProj">Projection Destination (SRID) :</label>
|
<label for="dstProj">Projection Destination (SRID) :</label>
|
||||||
<select id="dstProj" name="dstProj" required>
|
<select id="dstProj" name="dstProj" required>
|
||||||
<option value="2154" selected>RGF93 / Lambert-93 (France)</option>
|
<option value="2154" selected>RGF93 / Lambert-93 (France)</option>
|
||||||
|
<option value="3947">RGF93 / CC47 (France)</option>
|
||||||
<option value="4326">WGS 84 (GPS)</option>
|
<option value="4326">WGS 84 (GPS)</option>
|
||||||
<option value="3857">WGS 84 / Pseudo-Mercator (Web)</option>
|
<option value="3857">WGS 84 / Pseudo-Mercator (Web)</option>
|
||||||
<option value="4258">ETRS89 (Europe)</option>
|
<option value="4258">ETRS89 (Europe)</option>
|
||||||
|
Reference in New Issue
Block a user