2016-07-08 04:42:44 +08:00
|
|
|
# This Dockerfile builds a production-ready image of K2 to be used across all
|
|
|
|
# services. See the Dockerfile documentation here:
|
|
|
|
# https://docs.docker.com/engine/reference/builder/
|
|
|
|
|
2016-07-07 07:22:32 +08:00
|
|
|
# Use the latest Node 6 base docker image
|
2016-07-07 06:30:35 +08:00
|
|
|
# https://github.com/nodejs/docker-node
|
|
|
|
FROM node:6
|
2017-03-28 05:45:00 +08:00
|
|
|
ENV INSTALL_TARGET=cloud
|
2016-07-07 07:22:32 +08:00
|
|
|
|
|
|
|
# Copy everything (excluding what's in .dockerignore) into an empty dir
|
2016-07-08 04:36:38 +08:00
|
|
|
COPY . /home
|
2016-07-07 07:22:32 +08:00
|
|
|
WORKDIR /home
|
|
|
|
|
2017-02-18 02:47:01 +08:00
|
|
|
# This installs global dependencies, then in the postinstall script, runs lerna
|
2017-02-18 04:05:29 +08:00
|
|
|
# bootstrap to install and link cloud-api, cloud-core, and cloud-workers.
|
|
|
|
# We need the --unsafe-perm param to run the postinstall script since Docker
|
|
|
|
# will run everything as sudo
|
2017-02-22 03:33:00 +08:00
|
|
|
RUN npm install --unsafe-perm
|
2016-07-07 07:22:32 +08:00
|
|
|
|
2016-12-17 02:08:21 +08:00
|
|
|
# This uses babel to compile any es6 to stock js for plain node
|
2017-02-18 02:47:01 +08:00
|
|
|
RUN node packages/cloud-core/build/build-n1-cloud
|
2016-12-17 02:08:21 +08:00
|
|
|
|
2016-11-23 05:24:26 +08:00
|
|
|
# External services run on port 80. Expose it.
|
2016-11-23 05:25:58 +08:00
|
|
|
EXPOSE 5100
|
2016-07-07 07:22:32 +08:00
|
|
|
|
|
|
|
# We use a start-aws command that automatically spawns the correct process
|
2017-02-18 04:05:29 +08:00
|
|
|
# based on environmpackages/cloud-coreent variables (which changes instance to instance)
|
2017-02-18 02:47:01 +08:00
|
|
|
CMD packages/cloud-core/_n1cloud_docker_launcher.sh ${AWS_SERVICE_NAME}
|