-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 772 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (26 loc) · 772 Bytes
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
FROM golang:1.19.8-alpine3.16
# Upgrade and Install bash
RUN apk update && apk upgrade \
&& apk add --no-cache bash
# Set the Current Working Directory inside the container
WORKDIR /go/src/app
# Copy sources
COPY go.mod go.sum wordpress_exporter.go ./
# Download all the dependencies
RUN go get -d -v ./...
# Install the package
RUN go install -v ./...
# Default env
ENV WORDPRESS_DB_HOST="" \
WORDPRESS_DB_PORT="3306" \
WORDPRESS_DB_USER="" \
WORDPRESS_DB_PASSWORD="" \
WORDPRESS_DB_NAME="" \
WORDPRESS_TABLE_PREFIX="wp_" \
WORDPRESS_SKIP_WOOCOMMERCE="false"
EXPOSE 9850
ADD /docker-entrypoint.sh /docker-entrypoint.sh
RUN set -x \
&& chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["wordpress_exporter"]