Skip to content

Commit

Permalink
Lighter Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Berhent committed Sep 3, 2022
1 parent e57f2d6 commit baad20d
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
FROM appditto/libvips:latest
FROM appditto/libvips:latest as builder

WORKDIR /root

# add source code
ADD . .
# add assets
ADD assets assets
# Dependencies and buil
# Install dependencies, libvips, go, and cleanup
RUN go get \
&& go build -o natricon
# Build
RUN go build -o /root/natricon

ENV ENVIRONMENT "production"
FROM ubuntu:22.04

ENV MALLOC_ARENA_MAX=2
COPY --from=builder /root/natricon /usr/local/bin/natricon

ENV MALLOC_ARENA_MAX=2
ENV GIN_MODE="release"

# Install libvips
RUN apt-get update && apt-get install -y \
libvips-dev \
&& rm -rf /var/lib/apt/lists/*

# run main.go
CMD ["./natricon", "-host=0.0.0.0", "-port=5555", "-logtostderr"]
CMD ["natricon", "-host=0.0.0.0", "-port=5555", "-logtostderr"]

0 comments on commit baad20d

Please sign in to comment.