initial bot
This commit is contained in:
		
						commit
						2c7a5dff6c
					
				
					 7 changed files with 747 additions and 0 deletions
				
			
		
							
								
								
									
										45
									
								
								Dockerfile
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								Dockerfile
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,45 @@
 | 
			
		|||
FROM golang:1.22-alpine AS builder
 | 
			
		||||
 | 
			
		||||
# Install build dependencies
 | 
			
		||||
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 *.go ./
 | 
			
		||||
 | 
			
		||||
# Build the application
 | 
			
		||||
RUN CGO_ENABLED=0 GOOS=linux go build -o discord-europa-fm
 | 
			
		||||
 | 
			
		||||
# Use a smaller base image for the final stage
 | 
			
		||||
FROM alpine:latest
 | 
			
		||||
 | 
			
		||||
# Install ffmpeg
 | 
			
		||||
RUN apk add --no-cache ffmpeg ca-certificates
 | 
			
		||||
 | 
			
		||||
# Copy the built executable
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
COPY --from=builder /app/discord-europa-fm .
 | 
			
		||||
 | 
			
		||||
# Environment variables
 | 
			
		||||
ENV DISCORD_TOKEN="" \
 | 
			
		||||
    DEBUG="" \
 | 
			
		||||
    GUILD_ID=""
 | 
			
		||||
 | 
			
		||||
# Run the bot
 | 
			
		||||
CMD if [ -n "$DEBUG" ] && [ -n "$GUILD_ID" ]; then \
 | 
			
		||||
      ./discord-europa-fm -debug -guild "$GUILD_ID"; \
 | 
			
		||||
    elif [ -n "$DEBUG" ]; then \
 | 
			
		||||
      ./discord-europa-fm -debug; \
 | 
			
		||||
    elif [ -n "$GUILD_ID" ]; then \
 | 
			
		||||
      ./discord-europa-fm -guild "$GUILD_ID"; \
 | 
			
		||||
    else \
 | 
			
		||||
      ./discord-europa-fm; \
 | 
			
		||||
    fi
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue