blob: dfae44feead71bd91c0798230aa4f11ba7cfdccb [file] [log] [blame]
Zack Williamsa13f9112017-04-27 20:16:50 -07001# xosproject/xos-ws
2# To build use: docker build -t xosproject/xos-ws .
3# To run use: docker run -p 3000:3000 -d xosproject/xos-ws
Matteo Scandoloe3ed0162016-12-01 10:09:12 -08004
Zack Williamsf80d5d02018-09-28 12:47:20 -07005FROM node:10.11-alpine
Matteo Scandoloe3ed0162016-12-01 10:09:12 -08006
Zack Williamsa13f9112017-04-27 20:16:50 -07007# Set environment variables
8ENV CODE_SOURCE .
9ENV CODE_DEST /var/www
10
11# Create app directory
12WORKDIR ${CODE_DEST}
13
Zack Williamsea89ebb2018-09-07 12:37:36 -070014# install librdkafka
15RUN apk --no-cache add -U python make bash g++
16
Zack Williamsa13f9112017-04-27 20:16:50 -070017# Copy over app dependencies and source files
18COPY ${CODE_SOURCE}/package.json ${CODE_DEST}/
19COPY ${CODE_SOURCE}/src/ ${CODE_DEST}/src/
20
21# Install app dependencies and create logdir
22RUN npm install --production \
23 && mkdir ${CODE_DEST}/logs
24
25EXPOSE 3000
26
Zack Williamsee2e2692017-04-15 17:08:52 -070027# Label image
28ARG org_label_schema_schema_version=1.0
29ARG org_label_schema_name=xos-rest-gw
30ARG org_label_schema_version=unknown
31ARG org_label_schema_vcs_url=unknown
32ARG org_label_schema_vcs_ref=unknown
33ARG org_label_schema_build_date=unknown
34ARG org_opencord_vcs_commit_date=unknown
35
36LABEL org.label-schema.schema-version=$org_label_schema_schema_version \
37 org.label-schema.name=$org_label_schema_name \
38 org.label-schema.version=$org_label_schema_version \
39 org.label-schema.vcs-url=$org_label_schema_vcs_url \
40 org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
41 org.label-schema.build-date=$org_label_schema_build_date \
42 org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date
43
Zack Williamsee2e2692017-04-15 17:08:52 -070044CMD [ "npm", "start" ]