Skip to content

Commit

Permalink
reorganize the repo, tidy up, fix Dockerfile and DC deployment, fix d…
Browse files Browse the repository at this point in the history
…emo_sockets.json
  • Loading branch information
krustowski committed Oct 18, 2024
1 parent 266f180 commit 20ed902
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 90 deletions.
4 changes: 0 additions & 4 deletions .docker/resolv.conf

This file was deleted.

14 changes: 10 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
!.docker/resolv.conf
.git*
.git/*
.github/*
*.example
*.backup
.gitignore
.env
.env.example

build/*
deployments/*

dish
main

# README.md
# Dockerfile
# docker-compose.yml

8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.env
savla-dish
.vscode/
vendor/
.vscode/*
vendor/*

# binaries
dish
main
27 changes: 0 additions & 27 deletions Dockerfile

This file was deleted.

37 changes: 37 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#
# dish / Dockerfile
#

#
# stage 0 --- build
#

# https://hub.docker.com/_/golang

ARG ALPINE_VERSION 3.20
ARG GOLANG_VERSION 1.23
FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} AS dish-build

LABEL org.opencontainers.image.authors="[email protected], [email protected], [email protected]"

ARG APP_NAME dish

WORKDIR /go/src/${APP_NAME}
COPY . /go/src/${APP_NAME}

# build and install the binary
RUN go install cmd/dish/main.go

#
# stage 1 --- release
#

FROM alpine:${ALPINE_VERSION} AS dish-release

WORKDIR /opt

COPY configs/demo_sockets.json /opt/
COPY --from=dish-build /go/bin/main /opt/dish
RUN ln -s /opt/dish /usr/local/bin

ENTRYPOINT [ "dish" ]
25 changes: 25 additions & 0 deletions configs/demo_sockets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"items": {
"vxn_dev_https": {
"socket_name": "vxn-dev HTTPS",
"host_name": "https://vxn.dev",
"port_tcp": 443,
"path_http": "/",
"expected_http_code_array": [ 200 ]
},
"text.n0p.cz_https": {
"socket_name": "text-n0p-cz HTTPS",
"host_name": "https://text.n0p.cz",
"port_tcp": 443,
"path_http": "/?",
"expected_http_code_array": [ 401 ]
},
"openttd TCP": {
"socket_name": "openttd TCP",
"host_name": "ottd.vxn.dev",
"port_tcp": 3979,
"path_http": "",
"expected_http_code_array": []
}
}
}
File renamed without changes.
25 changes: 0 additions & 25 deletions demo_sockets.json

This file was deleted.

19 changes: 19 additions & 0 deletions deployments/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# dish / _EXAMPLE_ docker-compose.yml file
# mainly used for dish binary building process, as the binary itself does not serve any HTTP
name: ${PROJECT_NAME}

services:
dish:
image: ${DOCKER_IMAGE_TAG}
container_name: ${DOCKER_DEV_CONTAINER}
restart: "no"
command: ["-verbose"]
build:
context: ..
dockerfile: build/Dockerfile
args:
ALPINE_VERSION: ${ALPINE_VERSION}
APP_NAME: ${APP_NAME}
APP_FLAGS: ${APP_FLAGS}
GOLANG_VERSION: ${GOLANG_VERSION}

27 changes: 0 additions & 27 deletions docker-compose.yml

This file was deleted.

0 comments on commit 20ed902

Please sign in to comment.