This repository has been archived by the owner on Feb 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DockerfileOLD
68 lines (47 loc) · 1.56 KB
/
DockerfileOLD
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
###### START WITH NODE 6.1 (compatible with new AWS lambda... because yeah why not)
FROM mhart/alpine-node:8
MAINTAINER James Villarrubia "[email protected]"
###### THE STANDARD STUFF INSTALL
#RUN apt-get update
#RUN apt-get -y install \
# build-essential \
# wget \
#unzip \
# git
# Default to UTF-8 file.encoding
ENV LANG C.UTF-8
# add a simple script that can auto-detect the appropriate JAVA_HOME value
# based on whether the JDK or only the JRE is installed
RUN { \
echo '#!/bin/sh'; \
echo 'set -e'; \
echo; \
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
} > /usr/local/bin/docker-java-home \
&& chmod +x /usr/local/bin/docker-java-home
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
ENV JAVA_VERSION 8u111
ENV JAVA_ALPINE_VERSION 8.111.14-r0
RUN set -x \
&& apk add --no-cache \
openjdk8="$JAVA_ALPINE_VERSION" \
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]
RUN apk update \
&& apk add ca-certificates wget \
&& update-ca-certificates
###### NOW THE HEART OF THE MATTER
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Download and unzip the stanford library
# RUN wget -O ner.zip http://nlp.stanford.edu/software/stanford-ner-2015-04-20.zip
RUN wget -O ner.zip https://nlp.stanford.edu/software/stanford-ner-2018-10-16.zip
RUN unzip ner.zip
# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install
# Bundle app source
COPY ./index.js /usr/src/app
EXPOSE 8080
CMD [ "npm", "start" ]