dockerfile文件展示
# 1、php
FROM php:7.2.34-fpm-alpine
WORKDIR /app
ENV TZ "Asia/Shanghai"
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g" /etc/apk/repositories \
&& apk add --no-cache autoconf g++ libtool make curl-dev libxml2-dev linux-headers \
&& docker-php-ext-install -j 2 zip \
&& apk add --no-cache freetype-dev libjpeg-turbo-dev libpng-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j 2 gd \
&& docker-php-ext-install -j$(nproc) bcmath \
&& docker-php-ext-install -j 2 mysqli \
&& docker-php-ext-install pdo_mysql
copy . .
RUN chown -R www-data:www-data /app
EXPOSE 9000
ENTRYPOINT ["php-fpm"]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 2、python
#This is SMS Dockerfile
#Version 1.0
#Author: LYW
#基础镜像
FROM daocloud.io/library/centos
#维护者信息
MAINTAINER LYW
# 标签
LABEL version="1.0"
# 安装依赖
RUN yum -y install wget gcc gcc-c++ make openssl-devel \
zlib-devel bzip2-devel ncurses-devel \
sqlite-devel readline-devel tk-devel \
gdbm-devel db4-devel libpcap-devel xz-devel svn
# 添加需要下载的资源
RUN mkdir /usr/local/python3
ADD http://XXX/software/Python-3.6.1.tgz /usr/local/src
WORKDIR /usr/local/src/
RUN tar -zxvf Python-3.6.1.tgz
WORKDIR /usr/local/src/Python-3.6.1
# 安装python
RUN ./configure --prefix=/usr/local/python3
RUN make && make install
RUN ln -s /usr/local/python3/bin/python3 /usr/bin/python3
# 安装pip包
RUN /usr/local/python3/bin/pip3 install Flask
RUN /usr/local/python3/bin/pip3 install pymysql
#目录挂载
VOLUME ['/data/sms']
#端口
EXPOSE 5000
EXPOSE 22
#声明环境变量
ENV PATH /usr/local/python3/bin:$PATH
#
CMD ["python3 -V"]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# go
FROM golang:1.16.7-alpine3.13 AS builder
LABEL stage=gobuilder
ENV CGO_ENABLED 0
ENV GOOS linux
ENV GOPROXY https://goproxy.cn,direct
ARG VERSION
ARG GIT_COMMIT
ARG GIT_TREE_STATE
ARG BUILD_DATE
WORKDIR /build/zero
ADD go.mod .
ADD go.sum .
RUN go mod download
COPY . .
RUN go build -ldflags="-s -w -X trade/common/version.GitVersion=${VERSION} -X trade/common/version.GitCommit=${GIT_COMMIT} -X trade/common/version.GitTreeState=${GIT_TREE_STATE} -X trade/common/version.BuildDate=${BUILD_DATE}" -o /app/backend api/backend/backend.go
FROM alpine:3.13
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
RUN apk update --no-cache && apk add --no-cache ca-certificates tzdata
ENV TZ Asia/Shanghai
WORKDIR /app
COPY --from=builder /app/backend /app/backend
COPY --from=builder /build/zero/api/backend/etc /app/etc
EXPOSE 8888
CMD ["./backend"]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# node
FROM node:8.15.0-alpine-i18n AS builder
LABEL stage=h5builder
WORKDIR /app
COPY . .
RUN npm cache verify && npm i && npm run build
FROM nginx:1.14.2-alpine
COPY /app/dist /usr/share/nginx/html
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
# c++
FROM debian:buster
ENV TZ Asia/Shanghai
WORKDIR /app
ENV LD_LIBRARY_PATH=/app/lib
COPY . .
RUN ln -s libssl.so.1.0.2k ./lib/libssl.so.10 && ln -s libcrypto.so.1.0.2k ./lib/libcrypto.so.10
EXPOSE 9101
CMD ["./bin/trade_service"]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
上次更新: 2024/12/04, 17:15:49