Remove docker compose from integration tests because of the testcontainers dependency nightmare (#34)

* Remove docker compose from integration tests because of the testcontainers dependency nightmare
This commit is contained in:
2024-06-01 19:12:14 +02:00
committed by GitHub
parent aaf8a3b163
commit 4492f77d87
7 changed files with 159 additions and 774 deletions

15
test/Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM golang:1.22-alpine as builder
ARG ARG_VERSION
ENV VERSION $ARG_VERSION
WORKDIR /app
COPY . .
FROM builder AS build-test-app
RUN CGO_ENABLED=0 \
go build -ldflags="-s -w" -o whatismyip ./cmd
FROM scratch AS test
COPY --from=build-test-app /app/whatismyip /usr/bin/
ENTRYPOINT ["whatismyip"]

View File

@ -1,35 +0,0 @@
services:
whatismyip:
build:
context: ../
target: dev
ports:
- "8000:8000"
- "8001:8001"
- "8001:8001/udp"
- "53531:53/udp"
command:
- "-geoip2-city"
- "/GeoIP2-City-Test.mmdb"
- "-geoip2-asn"
- "/GeoLite2-ASN-Test.mmdb"
- "-bind"
- ":8000"
- "-tls-bind"
- ":8001"
- "-tls-crt"
- "/server.pem"
- "-tls-key"
- "/server.key"
- "-trusted-header"
- "X-Real-IP"
- "-enable-secure-headers"
- "-enable-http3"
- "-resolver"
- "/resolver.yml"
volumes:
- ./GeoIP2-City-Test.mmdb:/GeoIP2-City-Test.mmdb
- ./GeoLite2-ASN-Test.mmdb:/GeoLite2-ASN-Test.mmdb
- ./server.pem:/server.pem
- ./server.key:/server.key
- ./resolver.yml:/resolver.yml