Skip to content

Commit

Permalink
fix: create volume for SQLite database in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ndonathan committed Dec 21, 2024
1 parent 27039ff commit 455efac
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@ RUN CGO_ENABLED=1 go build -o server-info-api main.go
# Final stage
FROM golang:1.23.4-bookworm AS final

# Install required dependencies for SQLite
# RUN apt add --no-cache libc6-compat

WORKDIR /app

# Create directory for SQLite database
RUN mkdir -p /app/data

# Copy the binary from the builder stage to the correct location
COPY --from=builder /build/server-info-api /app/
COPY --from=builder /build/data.csv /app/data

# ensure executable is ...well .. executable.
RUN chmod +x /app/server-info-api

# Create directory for SQLite database
RUN mkdir -p /app/data

# create volume for SQLite database
VOLUME /app/data

# Expose the application port
EXPOSE 8080

Expand Down

0 comments on commit 455efac

Please sign in to comment.