ruby version
This commit is contained in:
32
Dockerfile
32
Dockerfile
@@ -1,31 +1,17 @@
|
||||
# Build stage
|
||||
FROM golang:1.26.1-alpine AS builder
|
||||
FROM ruby:3.3-alpine
|
||||
|
||||
RUN apk add --no-cache git build-base
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
COPY go.mod ./
|
||||
# COPY go.sum ./ # Uncomment if you have a go.sum file
|
||||
RUN go mod download
|
||||
COPY Gemfile Gemfile.lock ./
|
||||
RUN bundle install
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
COPY bbs.rb ./
|
||||
COPY lib/ ./lib/
|
||||
|
||||
# Build the application
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o bbs-server main.go
|
||||
RUN mkdir -p /app/data
|
||||
|
||||
# Final stage
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk --no-cache add ca-certificates tzdata
|
||||
|
||||
WORKDIR /root/
|
||||
|
||||
# Copy the binary from the builder stage
|
||||
COPY --from=builder /app/bbs-server .
|
||||
|
||||
# Expose the port
|
||||
EXPOSE 2323
|
||||
|
||||
# Run the binary
|
||||
CMD ["./bbs-server"]
|
||||
CMD ["bundle", "exec", "ruby", "bbs.rb"]
|
||||
|
||||
Reference in New Issue
Block a user