Skip to content

Instantly share code, notes, and snippets.

View yottta's full-sized avatar

Andrei Ciobanu yottta

  • Brasov, Romania
View GitHub Profile
@yottta
yottta / docker-compose.yml
Last active March 26, 2019 10:25
Medium article about WebSockets throughout Varnish - docker-compose.yml with varnish
version: "3"
services:
web:
build: ./web
container_name: web-client
networks:
- internal-network
server:
build: ./server
container_name: product-service
@yottta
yottta / user.vcl
Last active March 27, 2019 09:16
Medium article about WebSockets throughout Varnish - user.vcl 1
vcl 4.1;
backend default {
.host = "web-client";
.port = "80";
}
backend productService {
.host = "product-service";
.port = "8080";
@yottta
yottta / Dockerfile
Last active March 27, 2019 09:16
Medium article about WebSockets throughout Varnish - varnish Dockerfile 1
FROM debian:jessie
RUN \
useradd -r -s /bin/false varnishd
# Install Varnish source build dependencies.
RUN \
apt-get update && apt-get install -y --no-install-recommends \
automake \
build-essential \
@yottta
yottta / docker-compose.yml
Last active March 26, 2019 06:40
Medium article about WebSockets throughout Varnish - docker-compose.yml without varnish
version: "3"
services:
web:
build: ./web
container_name: websocket-client
ports:
- "8081:80"
server:
build: ./server
container_name: product-service
@yottta
yottta / Dockerfile
Created March 26, 2019 06:17
Medium article about WebSockets throughout Varnish - Web Client Dockerfile
FROM nginx
COPY index.html /usr/share/nginx/html
@yottta
yottta / Dockerfile
Last active March 26, 2019 06:14
Medium article about WebSockets throughout Varnish - dockerfile productService
FROM golang:1.12.1
WORKDIR /ws-server
ADD main.go go.sum go.mod /ws-server/
RUN go build
ENTRYPOINT ["/ws-server/product-service"]
@yottta
yottta / index.html
Created March 25, 2019 13:27
Medium article about WebSockets throughout Varnish - initial web client
<!DOCTYPE html>
<html>
<head>
<title>Products</title>
</head>
<body>
<p>Product List:</p>
<ul id="products">
</ul>
<script>
@yottta
yottta / main.go
Last active March 25, 2019 14:12
Medium article about WebSockets throughout Varnish
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"sync"
@yottta
yottta / main.go
Last active January 13, 2019 16:46
Stream files from an S3 bucket
package main
import (
"context"
"fmt"
"log"
"net"
"net/http"
"os"
"sync"