forked from 0xOutOfGas/solidctf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (29 loc) · 1.07 KB
/
Dockerfile
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
FROM golang:1.20-buster as protoc
WORKDIR /protobuf-build
RUN apt update && apt install unzip
RUN go install github.com/verloop/twirpy/protoc-gen-twirpy@latest
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.19.5/protoc-3.19.5-linux-x86_64.zip && unzip protoc-3.19.5-linux-x86_64.zip && cp bin/protoc /bin/protoc
COPY solidctf/protobuf protobuf
RUN protoc --python_out=. --twirpy_out=. protobuf/challenge.proto
FROM node:lts-alpine as frontend
WORKDIR /frontend-build
COPY web/package.json web/yarn.lock ./
RUN yarn install
COPY web ./
COPY solidctf/protobuf/challenge.proto .
RUN apk add --no-cache protoc
RUN yarn build
FROM python:3.9-slim-buster
WORKDIR /ctf
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY server.py .
COPY solidctf solidctf
COPY example/contracts contracts
COPY example/challenge.yml challenge.yml
COPY --from=protoc /protobuf-build/protobuf solidctf/protobuf
COPY --from=frontend /frontend-build/dist web/dist
COPY entrypoint.sh /entrypoint.sh
RUN mkdir /var/log/ctf
RUN chmod +x /entrypoint.sh
CMD ["/entrypoint.sh"]