forked from opendevops-cn/codo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
21 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,23 @@ | ||
FROM centos:7 | ||
# 设置编码 | ||
ENV LANG en_US.UTF-8 | ||
# 同步时间 | ||
ENV TZ=Asia/Shanghai | ||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
FROM registry.cn-hangzhou.aliyuncs.com/ss1917/codo-node:v10.16.1 | ||
|
||
# 1. 安装基本依赖和nginx | ||
RUN yum update -y && yum install epel-release -y && yum update -y && yum install wget nginx git -y | ||
WORKDIR /app | ||
|
||
# 2. 准备node | ||
RUN wget -q -c https://npm.taobao.org/mirrors/node/v10.16.1/node-v10.16.1-linux-x64.tar.xz && tar xf node-v10.16.1-linux-x64.tar.xz -C /usr/local/ | ||
RUN rm -rf /usr/local/bin/node && rm -rf /usr/local/bin/npm \ | ||
&& ln -s /usr/local/node-v10.16.1-linux-x64/bin/node /usr/local/bin/node \ | ||
&& ln -s /usr/local/node-v10.16.1-linux-x64/bin/node /usr/bin/node \ | ||
&& ln -s /usr/local/node-v10.16.1-linux-x64/bin/npm /usr/local/bin/npm \ | ||
&& ln -s /usr/local/node-v10.16.1-linux-x64/bin/npm /usr/bin/npm | ||
MAINTAINER "shenshuo<[email protected]>" | ||
|
||
# 4. 复制代码 | ||
# 复制代码 | ||
RUN mkdir -p /app | ||
WORKDIR /app | ||
ADD . /app | ||
|
||
RUN rm -rf /app/node_modules && npm config set registry https://registry.npmjs.org/ \ | ||
&& npm cache clean --force \ | ||
&& npm install --ignore-script \ | ||
&& npm cache clean --force \ | ||
&& npm install --ignore-script \ | ||
&& npm run build \ | ||
&& mkdir -p /var/www/codo && cp -r /app/dist/* /var/www/codo/ | ||
|
||
# 5. 日志 | ||
VOLUME /var/log/ | ||
VOLUME /var/log/nginx/ | ||
|
||
# 6. 准备文件 | ||
COPY nginx_ops.conf /etc/nginx/conf.d/default.conf | ||
# 6. 准备文件 请注意如果要修改访问的域名,请在编译之前修改nginx_ops.conf 的server_name | ||
# COPY nginx_ops.conf /etc/nginx/conf.d/default.conf | ||
|
||
# 开放端口 | ||
EXPOSE 80 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
codo: | ||
restart: unless-stopped | ||
image: codo_image | ||
volumes: | ||
- /var/log/nginx/:/var/log/nginx/ | ||
- /my/nginx/:/etc/nginx/ | ||
- /sys/fs/cgroup:/sys/fs/cgroup | ||
ports: | ||
- "80:80" | ||
- "443:443" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters