1
0
Fork 0
mirror of https://github.com/anyproto/any-sync-dockercompose.git synced 2025-06-08 14:07:02 +09:00

Merge pull request #22 from anyproto/18-updating-using-make-update-rewrites-configuration-file

docker-generateconfig fix
This commit is contained in:
Grigory Efimov 2024-02-14 10:57:27 -03:00 committed by GitHub
commit ff0327d944
Signed by: github
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 3 deletions

View file

@ -2,11 +2,12 @@ FROM golang:1.21.6-alpine3.19 as generator
RUN apk add --no-cache bash yq RUN apk add --no-cache bash yq
RUN go install github.com/anyproto/any-sync-tools/anyconf@latest RUN go install github.com/anyproto/any-sync-tools/anyconf@latest
WORKDIR /opt/generateconfig WORKDIR /opt/generateconfig
COPY ./storage/docker-generateconfig/ .
COPY --chmod=777 docker-generateconfig/generate_config.sh .env . COPY --chmod=777 docker-generateconfig/generate_config.sh .env .
RUN ./generate_config.sh RUN ./generate_config.sh
FROM alpine:3.18.4 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 WORKDIR /opt/processing
COPY docker-generateconfig/etc/ tmp-etc/ COPY docker-generateconfig/etc/ tmp-etc/
COPY --chmod=777 docker-generateconfig/processing.sh . COPY --chmod=777 docker-generateconfig/processing.sh .

View file

@ -2,8 +2,9 @@
include .env include .env
generate_config: generate_config:
mkdir -p ./storage/docker-generateconfig/
docker build -t generateconfig -f Dockerfile-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 start: generate_config
docker compose up -d docker compose up -d
@ -14,7 +15,7 @@ stop:
docker compose stop docker compose stop
clean: clean:
docker system prune --all docker system prune --all --volumes
pull: pull:
docker compose pull docker compose pull

View file

@ -69,3 +69,6 @@ placeholders=(
for placeholder in "${placeholders[@]}"; do for placeholder in "${placeholders[@]}"; do
perl -i -pe "s|%${placeholder}%|${!placeholder}|g" "${network_file}" "${dest_path}/"/*/*.yml perl -i -pe "s|%${placeholder}%|${!placeholder}|g" "${network_file}" "${dest_path}/"/*/*.yml
done done
# save generated configs
rsync -a --delete generateconfig/ /opt/processing/docker-generateconfig