nextinbox / Dockerfile
loko-dev's picture
Change exposed port from 8080 to 7860 in Dockerfile
162fe07
raw
history blame contribute delete
755 Bytes
# Use a lightweight Go image for building
FROM golang:1.23.2-alpine AS builder
# Install necessary tools in the builder image
RUN apk add --no-cache git
# Set the working directory inside the container
WORKDIR /app
# Copy Go module files first and download dependencies
COPY go.mod go.sum ./
RUN go mod download
# COPY .env .env
# Copy the rest of the application files
COPY . .
# Build the application
RUN go build -o nextinbox
# Start a new stage with a minimal image
FROM alpine:latest
# Set the working directory
WORKDIR /app
# Copy the built binary file from the builder stage
COPY --from=builder /app/nextinbox .
COPY doc.html doc.html
# Expose the port your app listens on
EXPOSE 7860
# Command to run the application
CMD ["./nextinbox"]