This repository has been archived by the owner on Nov 22, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
52 lines (37 loc) · 1.4 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# The base image we want to use
# It's a linux distro with Node pre-installed (26MB)
FROM node:10.16
# Download Go
RUN wget https://dl.google.com/go/go1.12.2.linux-amd64.tar.gz
# Unpack tar file
RUN tar -xvf go1.12.2.linux-amd64.tar.gz
# Move unpacked go directory to /usr/local
RUN mv go /usr/local
# Set env variable for where GO binary tool is
ENV GOROOT=/usr/local/go
# Set env variable for where GO will download & install GO packages
ENV GOPATH=$HOME/go
# Put GO into the PATH so typing go from command line will work
ENV PATH=$PATH:$GOROOT/bin
# install the VALE linting tool from GitHub as a GO package
RUN go get github.com/errata-ai/vale
# Set the /go/bin/vale into the path
ENV PATH=$PATH:/go/bin/
# Set the working directory in the image
# Used for COPY/RUN commands below...
WORKDIR /usr/src/app
# Copy package.json npm & stuff into image
COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
# Do an NPM install
RUN npm install
# Copy everything over from current directory
# It will exclude files/directories that match in the .dockerignore file
COPY . .
# npm run build (Compile TypeScript)
# Not sure if npm install above wont be happy as dev-dependencies for compiling TypeScript
RUN npm run build
# Make port 3000 available
EXPOSE 3000
# Run command npm start - which boots up our ProBot app
# A simple NodeJS webserver that listens/respondes to WebHooks from GitHub
CMD npm start