mirror of
https://github.com/anyproto/any-sync-dockercompose.git
synced 2025-06-08 05:47:03 +09:00
Merge pull request #22 from anyproto/18-updating-using-make-update-rewrites-configuration-file
docker-generateconfig fix
This commit is contained in:
commit
ff0327d944
3 changed files with 8 additions and 3 deletions
|
@ -2,11 +2,12 @@ FROM golang:1.21.6-alpine3.19 as generator
|
|||
RUN apk add --no-cache bash yq
|
||||
RUN go install github.com/anyproto/any-sync-tools/anyconf@latest
|
||||
WORKDIR /opt/generateconfig
|
||||
COPY ./storage/docker-generateconfig/ .
|
||||
COPY --chmod=777 docker-generateconfig/generate_config.sh .env .
|
||||
RUN ./generate_config.sh
|
||||
|
||||
FROM alpine:3.18.4
|
||||
RUN apk add --no-cache bash yq perl python3 py3-yaml
|
||||
RUN apk add --no-cache bash yq perl python3 py3-yaml rsync
|
||||
WORKDIR /opt/processing
|
||||
COPY docker-generateconfig/etc/ tmp-etc/
|
||||
COPY --chmod=777 docker-generateconfig/processing.sh .
|
||||
|
|
5
Makefile
5
Makefile
|
@ -2,8 +2,9 @@
|
|||
include .env
|
||||
|
||||
generate_config:
|
||||
mkdir -p ./storage/docker-generateconfig/
|
||||
docker build -t generateconfig -f Dockerfile-generateconfig .
|
||||
docker run --rm -v ${CURDIR}/etc:/opt/processing/etc --name any-sync-generator generateconfig
|
||||
docker run --rm --volume ${CURDIR}/etc:/opt/processing/etc --volume ${CURDIR}/storage/docker-generateconfig:/opt/processing/docker-generateconfig --name any-sync-generator generateconfig
|
||||
|
||||
start: generate_config
|
||||
docker compose up -d
|
||||
|
@ -14,7 +15,7 @@ stop:
|
|||
docker compose stop
|
||||
|
||||
clean:
|
||||
docker system prune --all
|
||||
docker system prune --all --volumes
|
||||
|
||||
pull:
|
||||
docker compose pull
|
||||
|
|
|
@ -69,3 +69,6 @@ placeholders=(
|
|||
for placeholder in "${placeholders[@]}"; do
|
||||
perl -i -pe "s|%${placeholder}%|${!placeholder}|g" "${network_file}" "${dest_path}/"/*/*.yml
|
||||
done
|
||||
|
||||
# save generated configs
|
||||
rsync -a --delete generateconfig/ /opt/processing/docker-generateconfig
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue