Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to Crystal #4

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
monitor
/bin
/lib
19 changes: 10 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
FROM golang:1.20-alpine AS build

COPY go.mod go.sum monitor.go /go/src/
RUN cd /go/src && go build monitor.go
# BUILD image
FROM crystallang/crystal:1.8-alpine AS build
COPY . /src
RUN cd /src && shards build --release --static

# RELEASE image
FROM jwilder/nginx-proxy:latest AS release

RUN apt-get -q update && \
apt-get install -y -q --no-install-recommends dnsmasq && \
apt-get -q clean && rm -r /var/lib/apt/lists/*

# override nginx configs
# override nginx configs & nginx-proxy templating
COPY *.conf /etc/nginx/conf.d/

# override nginx-proxy templating
COPY nginx.tmpl Procfile /app/
COPY --from=build /go/src/monitor /app/

# COPY htdocs /var/www/default/htdocs/
# install executable
COPY --from=build /src/bin/monitor /app/

# default configuration
ENV DOMAIN_TLD lvh.me
ENV NETWORK_NAME shared
ENV DNS_IP 127.0.0.1
ENV HOSTMACHINE_IP 127.0.0.1
28 changes: 0 additions & 28 deletions go.mod

This file was deleted.

142 changes: 0 additions & 142 deletions go.sum

This file was deleted.

59 changes: 0 additions & 59 deletions monitor.go

This file was deleted.

10 changes: 10 additions & 0 deletions shard.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2.0
shards:
docker:
git: https://github.com/jeromegn/docker.cr.git
version: 0.2.0

json_mapping:
git: https://github.com/crystal-lang/json_mapping.cr.git
version: 0.1.1

18 changes: 18 additions & 0 deletions shard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: dockerdev
version: 0.1.0

authors:
- Julien Portalier <[email protected]>

description: |
DockerDev HTTP Proxy

dependencies:
docker:
github: jeromegn/docker.cr

targets:
monitor:
main: src/monitor.cr

license: MIT
Loading