This article is from Aliyun-yun-Habitat community, the original click here.
In the experience of many project technology reform, the current technical framework has basically stabilized. The development of a person is not easy ah, want to share some of their ideas and go through some pits, hope to be able to help everyone. Let's put down my current technical framework.
Docker is a good thing, although Ali out of the function calculation, but in the use of time, found or lack of some of the heat, and now the function of the calculation or more suitable for high CPU-type API, humble see ~
The process of Ali Docker:
Create Ali's code warehouse create Docker mirror create Docker container service Create Docker, Ali will automatically deploy load balancing (HTTPS in next article update)
Generally, my project structure is this:-PROJECT-API/////react-native, Mobile end-WWW//Project homepage-admin/Project Back-end management system-H5//promotion H5-dockerfile/ The Deployment API uses
Generic Dockerfile with my API
From Node:7
maintainer mumudeveloper
#hardcode
RUN cp/usr/share/zoneinfo/asia/shanghai/etc/localtime
Run yarn Global Add Forever
# Create www directory
RUN mkdir-p/api
COPY./api/api
# Install www de Pendencies
workdir/api
RUN yarn Install
expose 7001
# Define default command.
EntryPoint Forever Start- l forever.log-a index.js && tail-f ~/.forever/forever.log
Good. The point is, knock on the blackboard.
Everyone notices that my line is not, well, this is the first pit I met when I ran Docker.
RUN Cp/usr/share/zoneinfo/asia/shanghai/etc/localtime
Last year, did a middleman platform, order is according to the time to set the price, a time a price, because the market is volatile, I was holding a very happy very happy feel that they are very flow force mood, the project deployed in the Docker. After the deployment, happily sleep, because tomorrow has to work. Suddenly 1 o'clock in the morning, the cooperation party calls, very anxious very anxious appearance, a answer telephone, my heart all cool, the evening submits thousands of orders, the time is wrong ...
Hurriedly get up, check the bug, now want to all heart Magsaysay ... orz ...
Open the full text