/
Tamerlan13
/
Tether-Messenger
Обзор
Документация
Войти
/
Tamerlan13
/
Tether-Messenger
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
server/Dockerfile
41 строка
781 B
Tamerlan Akhmedov
Добавил Docker, новые страницы и обновил серверную часть
06 окт 2025, 06:33
06 окт 2025, 06:33
97d6703
Код
Авторство
О чём код?
# Build stage FROM golang:1.21-alpine AS builder # Set working directory WORKDIR /app # Install git and ca-certificates (needed for go mod download) RUN apk add --no-cache git ca-certificates # Copy go mod files COPY go.mod go.sum ./ # Download dependencies RUN go mod download # Copy source code COPY . . # Build the application RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main . # Final stage FROM alpine:latest # Install ca-certificates for HTTPS requests RUN apk --no-cache add ca-certificates # Create app directory WORKDIR /root/ # Copy the binary from builder stage COPY --from=builder /app/main . # Copy uploads directory if it exists COPY --from=builder /app/uploads ./uploads # Expose port EXPOSE 8081 # Run the application CMD ["./main"]