# Debian GNU/Linux 8 (jessie)
FROM            registry.cn-hangzhou.aliyuncs.com/haigonggong/pg_base_node_service:latest

WORKDIR         /usr/src/app

COPY            build/. /usr/src/app/build/
COPY            static/. /usr/src/app/build/static/
COPY            run_api.sh /usr/src/app/
COPY            entrypoint.sh /usr/src/app/

# COPY            package.json /usr/src/app/build/static/system.package.json
# COPY            package-lock.json /usr/src/app/build/static/system.package-lock.json

RUN             cp /usr/src/app/pg_base.package.json /usr/src/app/build/static/pg_base.package.json
RUN             cp /usr/src/app/pg_base.package-lock.json /usr/src/app/build/static/pg_base.package-lock.json
RUN             cp /usr/src/app/pg_base.git_commit_version.txt /usr/src/app/build/static/pg_base.git_commit_version.txt
RUN             cp /usr/src/app/pg_base_node_service.package.json /usr/src/app/build/static/pg_base_node_service.package.json
RUN             cp /usr/src/app/pg_base_node_service.package-lock.json /usr/src/app/build/static/pg_base_node_service.package-lock.json
RUN             cp /usr/src/app/pg_base_node_service.git_commit_version.txt /usr/src/app/build/static/pg_base_node_service.git_commit_version.txt

# CMD		        ["sh", "/usr/src/app/run_api.sh"]
ENTRYPOINT      ["/usr/src/app/entrypoint.sh"]
