-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathweb.Dockerfile
More file actions
72 lines (49 loc) · 1.66 KB
/
Copy pathweb.Dockerfile
File metadata and controls
72 lines (49 loc) · 1.66 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM golang:1.23.4-alpine3.21 AS build-env
# TODO: gdevillele: we should not need git anymore (since we don't use VNDR anymore)
RUN apk update && apk add --no-cache \
git \
&& rm -rf /var/cache/apk/*
# copy web resources from voxowl/particubes repository
COPY public/particubes-dot-com/content/_templates /assets/templates
COPY public/particubes-dot-com/content/style /assets/style
COPY public/particubes-dot-com/content/img /assets/img
COPY public/particubes-dot-com/content/js /assets/js
COPY public/particubes-dot-com/content/video /assets/video
COPY public/particubes-dot-com/content/pages /assets/pages
COPY servers/web-private-files /private
# copy Go packages needed
COPY ./go/cu.bzh /go/cu.bzh
EXPOSE 80
WORKDIR /go/cu.bzh/webserver
ENTRYPOINT ["ash"]
#################################
FROM golang:1.23.4-alpine3.21 AS builder
# TODO: gdevillele: we should not need git anymore (since we don't use VNDR anymore)
RUN apk update && apk add --no-cache \
git \
&& rm -rf /var/cache/apk/*
COPY --from=build-env /go /go
COPY --from=build-env /assets /assets
COPY --from=build-env /private /private
WORKDIR /go/cu.bzh/webserver
ENV CGO_ENABLED 0
ENV GIN_MODE release
# TODO: remove this. We use Go Modules now
# ENV GO111MODULE off
RUN go build
EXPOSE 80
ENTRYPOINT ["ash"]
# ENTRYPOINT ["./webserver"]
#################################
FROM alpine:3.21 AS website
RUN apk update && apk add --no-cache \
ca-certificates \
&& rm -rf /var/cache/apk/*
COPY --from=builder /go/cu.bzh/webserver/webserver /webserver
COPY --from=builder /assets /assets
COPY --from=builder /private /private
EXPOSE 80
WORKDIR /
ENV GIN_MODE release
VOLUME /cache
ENTRYPOINT ["/webserver"]