about summary refs log tree commit diff
path: root/Dockerfile
blob: 036b2b4da00b2afc69dff9d55c610b0bfacbc0db (plain)
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
FROM golang:alpine

# Set up workdir
RUN mkdir -p /prod/persist
WORKDIR /prod

# Install OpenVPN
RUN apk update
RUN apk add openvpn iptables

# Copy our chainloader script
COPY chainloader.sh /prod/chainloader.sh
RUN chmod +x /prod/chainloader.sh

# Copy server and client config files
COPY server.conf /prod/server.conf
COPY client.conf /prod/client.conf
COPY nat.sh /prod/nat.sh
RUN chmod +x /prod/nat.sh

# Copy client config host code and compile it
COPY host.go /tmp/host.go
RUN go build -o /prod/confhost /tmp/host.go

# Create jail user
# (We're dropping it to this user in the chainloader script)
RUN adduser -u 1337 -D jail

# Ready to rumble.
CMD /prod/chainloader.sh