diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2025-06-04 00:11:41 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2025-06-04 00:11:41 +0200 |
| commit | a84d3cb7e9659b57ad3bbca6cc894a46fbf741fd (patch) | |
| tree | 9a032c6e6c716436084f346790a7901a09b67e23 /docker | |
| parent | cd971e758ba7669b94ea3d1d3c2bf2376550820f (diff) | |
Make integration actually work
Add logs
Add remote keys for each user
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/integration_test/docker-compose.yaml | 5 | ||||
| -rw-r--r-- | docker/integration_test/web/Dockerfile | 20 |
2 files changed, 23 insertions, 2 deletions
diff --git a/docker/integration_test/docker-compose.yaml b/docker/integration_test/docker-compose.yaml index 628973f..cd832be 100644 --- a/docker/integration_test/docker-compose.yaml +++ b/docker/integration_test/docker-compose.yaml @@ -30,6 +30,8 @@ services: - 'it_mariadb_data:/var/lib/mysql' remote_git: image: rockstorm/git-server:latest + environment: + - SSH_AUTH_METHODS=publickey ports: - '12222:22' volumes: @@ -40,7 +42,8 @@ services: environment: - SSH_AUTH_METHODS=publickey depends_on: - - web + web: + condition: service_healthy ports: - '10022:22' volumes: diff --git a/docker/integration_test/web/Dockerfile b/docker/integration_test/web/Dockerfile index 2ba7a5d..b9b2ad7 100644 --- a/docker/integration_test/web/Dockerfile +++ b/docker/integration_test/web/Dockerfile @@ -1,6 +1,6 @@ FROM archlinux:base -RUN pacman -Suy --noconfirm && pacman -S openssl git --noconfirm +RUN pacman -Suy --noconfirm && pacman -S openssh openssl git --noconfirm # Docker still have this really stupied idea that all files must be relative "context", # so context is set to ../.. relative the docker-compose.yaml @@ -8,8 +8,26 @@ COPY server/target/x86_64-unknown-linux-musl/debug/eyeballs-githook /app/eyeball COPY server/target/debug/eyeballs /app/eyeballs COPY docker/integration_test/web/setup.sh /app/setup.sh +RUN mkdir -p /git/auth /git/repos + +# git image runs as default git user, with uid 1000 gid 1000. +# we need the same, but it can't be named git (as package git installs a git user) +# so add another user with 1000 gid 1000 and make sure that shared files +# (/git/auth and /git/repos) are owned by that user and not root. +RUN useradd --no-create-home --uid 1000 --user-group -s /usr/bin/nologin alf + +RUN chown alf:alf /app +RUN chown alf:alf /git/auth +RUN chown alf:alf /git/repos +VOLUME /git/auth +VOLUME /git/repos + +USER alf:alf + RUN mkdir -p -m 0700 /app/.ssh COPY docker/integration_test/web/gitkey /app/.ssh/id_rsa WORKDIR /app ENTRYPOINT /app/setup.sh + +HEALTHCHECK --start-period=1s --interval=1m --timeout=1s CMD curl -f http://localhost:8000/api/v1/healthcheck |
