Skip to content

Commit ade672b

Browse files
committed
fix: properly deal with permissions in backup
1 parent ab91b29 commit ade672b

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ __pycache__
44
*.pyo
55
tests/
66
docs/
7+
weaviate_data/

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
6969
&& rm -rf /var/lib/apt/lists/*
7070

7171
# Create a non-root user
72-
RUN useradd -m -u 1000 -r codegate
72+
RUN useradd -m -u 1000 -r codegate
73+
74+
# Copy backup if needed
75+
RUN mkdir -p /tmp/weaviate_backup
76+
# will not fail if the file does not exist
77+
COPY weaviate_backu[p] /tmp/weaviate_backup
78+
RUN chown -R codegate /tmp/weaviate_backup
7379

7480
# Set permissions for user codegate to run nginx
7581
RUN chown -R codegate /var/lib/nginx && \
@@ -94,4 +100,4 @@ ENV PYTHONPATH=/app/src
94100

95101
# Set the container's default entrypoint
96102
EXPOSE 8989
97-
ENTRYPOINT ["/app/scripts/entrypoint.sh", "/app/weaviate_backup", "backup"]
103+
ENTRYPOINT ["/app/scripts/entrypoint.sh", "/tmp/weaviate_backup", "backup"]

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ build: clean test
3030
poetry build
3131

3232
image-build:
33-
$(CONTAINER_BUILD) -f Dockerfile -t codegate . -t ghcr.io/stacklok/codegate:$(VER) --load
34-
33+
DOCKER_BUILDKIT=1 $(CONTAINER_BUILD) -f Dockerfile --secret id=gh_token,env=GH_CI_TOKEN -t codegate . -t ghcr.io/stacklok/codegate:$(VER) --load
3534

3635
all: clean install format lint test security build

0 commit comments

Comments
 (0)