Skip to content

Commit

Permalink
Merge pull request #13 from maxmcd/docker-web-client
Browse files Browse the repository at this point in the history
Docker web client
  • Loading branch information
maxmcd authored Nov 18, 2018
2 parents 322d619 + a682617 commit ec7138d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 8 deletions.
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

0 comments on commit ec7138d

Please sign in to comment.