From 1dace08128365524df68947bd99b28b1db219ada Mon Sep 17 00:00:00 2001 From: Christoph Walther Date: Tue, 16 Jul 2024 14:27:18 +0200 Subject: [PATCH] Add Dockerfile with go:latest --- Dockerfile | 28 ++++++++++++++++++++++++++++ docker-compose.yml | 11 +++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..342b1b9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# Use a Golang base image +FROM golang:latest + +# Set the working directory inside the container +WORKDIR /go/src/app + +# Install dependencies and clone Poseidon repository +RUN apt-get update + # && \ + #apt-get install -y git && \ + #git clone https://github.com/openHPI/poseidon.git . + +COPY . . + +# Install make (required for building) +RUN apt-get install -y make + +# Install required project libraries +RUN make bootstrap + +# Build the binary +RUN make build + +# Expose the port on which Poseidon runs (adjust if necessary) +EXPOSE 8080 + +# Command to run Poseidon +CMD ["./poseidon"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8bac884 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +services: + poseidon: + build: + context: . + dockerfile: Dockerfile + ports: + - "7200:7200" + network_mode: host + volumes: + - ./configuration.yaml:/go/src/app/configuration.yaml + restart: unless-stopped