-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.server
More file actions
46 lines (35 loc) · 1.27 KB
/
Dockerfile.server
File metadata and controls
46 lines (35 loc) · 1.27 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
# syntax=docker/dockerfile:1
# Alpine is chosen for its small footprint
# compared to Ubuntu
FROM golang:1.17-alpine3.15
## We create an /app directory within our
## image that will hold our application source
## files
RUN mkdir /app
## We copy everything in the root directory
## into our /app directory
ADD ./go /app
## We specify that we now wish to execute
## any further commands inside our /app
## directory
WORKDIR /app
RUN apk --update add ca-certificates
RUN apk update && apk add --no-cache wget gzip curl nodejs nginx supervisor
RUN wget -O binary-for-linux-64-bit.gz 'https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz'
RUN gzip -d binary-for-linux-64-bit.gz
RUN mv ./binary-for-linux-64-bit /usr/local/bin/elm
## RUN rm binary-for-linux-64-bit.gz
RUN chmod +x /usr/local/bin/elm
## Add this go mod download command to pull in any dependencies
RUN go mod download
## we run go build to compile the binary
## executable of our Go program
RUN go build -o main .
COPY nginx.server.conf /etc/nginx/nginx.conf
COPY supervisor.conf /etc/supervisor.conf
# RUN nginx -t
# RUN nginx -c /etc/nginx/nginx.conf
# RUN nginx -s reload
## Our start command which kicks off
## our newly created binary executable
CMD ["supervisord", "-c", "/etc/supervisor.conf"]