5 Commits

4 changed files with 28 additions and 10 deletions
+2 -5
View File
@@ -17,13 +17,10 @@ WORKDIR /app
RUN apk add --no-cache libwebp libstdc++
RUN adduser -D -g '' appuser
COPY --from=builder /app/quay .
RUN chown -R appuser:appuser /app
USER appuser
RUN mkdir -p /storage /config && \
chmod -R 755 /storage /config
ENV PORT=4321
ENV CONFIG_DIR=/config
+4 -2
View File
@@ -35,7 +35,9 @@ func FetchAndDeployBranch(repoOwner, repoName, branch, pat, destDir string) erro
return fmt.Errorf("GitHub returned %s for %s", resp.Status, archiveURL)
}
tmpZip, err := os.CreateTemp("", "ghbranch-*.zip")
storageRoot := filepath.Dir(destDir)
tmpZip, err := os.CreateTemp(storageRoot, "ghbranch-*.zip")
if err != nil {
return fmt.Errorf("creating temp zip: %w", err)
}
@@ -47,7 +49,7 @@ func FetchAndDeployBranch(repoOwner, repoName, branch, pat, destDir string) erro
}
tmpZip.Close()
tmpDir, err := os.MkdirTemp("", "ghbranch-unpack-*")
tmpDir, err := os.MkdirTemp(storageRoot, "ghbranch-unpack-*")
if err != nil {
return fmt.Errorf("creating temp dir: %w", err)
}
+21
View File
@@ -0,0 +1,21 @@
services:
quay:
build:
context: .
dockerfile: Dockerfile
container_name: quay
env_file:
- .env
ports:
- '8080:4321'
volumes:
- ./config:/config
- ./storage:/storage
restart: unless-stopped
healthcheck:
test:
['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost/health']
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
+1 -3
View File
@@ -1,8 +1,6 @@
services:
quay:
build:
context: .
dockerfile: Dockerfile
image: kartoffelchipss/quay:latest
container_name: quay
env_file:
- .env