Add additional project structure, config, Docker support, and more prompt files
This commit is contained in:
53
Dockerfile
Normal file
53
Dockerfile
Normal file
@@ -0,0 +1,53 @@
|
||||
# Dockerfile for MEV Bot
|
||||
|
||||
# Build stage
|
||||
FROM golang:1.24-alpine AS builder
|
||||
|
||||
# Install git (needed for go mod download with private repos)
|
||||
RUN apk add --no-cache git
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy go mod and sum files
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
# Download dependencies
|
||||
RUN go mod download
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build the application
|
||||
RUN go build -o bin/mev-bot cmd/mev-bot/main.go
|
||||
|
||||
# Final stage
|
||||
FROM alpine:latest
|
||||
|
||||
# Install ca-certificates for HTTPS requests
|
||||
RUN apk --no-cache add ca-certificates
|
||||
|
||||
# Create a non-root user
|
||||
RUN adduser -D -s /bin/sh mevbot
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the binary from builder stage
|
||||
COPY --from=builder /app/bin/mev-bot .
|
||||
|
||||
# Copy config files
|
||||
COPY --from=builder /app/config ./config
|
||||
|
||||
# Change ownership to non-root user
|
||||
RUN chown -R mevbot:mevbot .
|
||||
|
||||
# Switch to non-root user
|
||||
USER mevbot
|
||||
|
||||
# Expose port (if needed for any web interfaces)
|
||||
EXPOSE 8080
|
||||
|
||||
# Command to run the application
|
||||
ENTRYPOINT ["./mev-bot"]
|
||||
CMD ["start"]
|
||||
Reference in New Issue
Block a user