-
-
Notifications
You must be signed in to change notification settings - Fork 397
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (42 loc) · 1.23 KB
/
Dockerfile
File metadata and controls
53 lines (42 loc) · 1.23 KB
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
47
48
49
50
51
52
53
FROM golang:1.24-bullseye AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
g++ \
pkg-config \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ENV CGO_ENABLED=1
RUN go build -o wuzapi
FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
netcat-openbsd \
postgresql-client \
openssl \
curl \
ffmpeg \
tzdata \
&& rm -rf /var/lib/apt/lists/*
ENV TZ="America/Sao_Paulo"
WORKDIR /app
COPY --from=builder /app/wuzapi /app/
COPY --from=builder /app/static /app/static/
COPY --from=builder /app/wuzapi.service /app/wuzapi.service
RUN chmod +x /app/wuzapi && \
chmod -R 755 /app && \
chown -R root:root /app
ENTRYPOINT ["/app/wuzapi", "--logtype=console", "--color=true"]