Skip to content
Merged
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
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,12 @@ FROM golang:1.11.2-stretch

RUN apt-get update && \
curl -sL https://deb.nodesource.com/setup_11.x | bash -\
&& apt-get install -y nodejs libssl-dev
&& apt-get install -y --no-install-recommends \
nodejs=11.2.0* \
libssl-dev=1.1.0* \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /go/src/github.com/maxmcd/webtty


13 changes: 11 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
version: '3.3'
services:
app:
build: .
base:
build:
context: .
dockerfile: Dockerfile
image: maxmcd/webtty-node-go
web-client:
build:
context: .
dockerfile: ./web-client/Dockerfile
image: maxmcd/webtty-client
ports:
- 8080:80
17 changes: 17 additions & 0 deletions web-client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM maxmcd/webtty-node-go:latest as builder

COPY . .
RUN go get -v . \
&& cd ./web-client \
&& npm install \
&& npm run build

FROM nginx:alpine

RUN echo "application/wasm wasm" >> /etc/mime.types \
&& sed -i -e 's/wmlc;/wmlc;\n application\/wasm wasm;\n/g' /etc/nginx/mime.types

COPY --from=builder \
/go/src/github.com/maxmcd/webtty/web-client/dist \
/usr/share/nginx/html

14 changes: 9 additions & 5 deletions web-client/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"name": "webtty",
"version": "0.0.1",
"description": "",
"main": "app.js",
"version": "0.0.2",
"description": "webtty web client",
"repository": {
"type": "git",
"url": "git+https://github.com/maxmcd/webtty.git"
},
"main": "src/app.ts",
"scripts": {
"build": "npm run go-build && parcel build src/index.html --public-url .",
"go-build":
Expand All @@ -11,8 +15,8 @@
"test": "echo notests",
"deploy": "npm run build && gh-pages -d dist"
},
"author": "",
"license": "ISC",
"author": "Max McDonnell",
"license": "MIT",
"dependencies": {
"@babel/core": "^7.1.5",
"@babel/runtime-corejs2": "^7.1.5",
Expand Down