Add dockerfile and entrypoint script

This commit is contained in:
Craig J. Midwinter
2018-12-07 15:12:15 -06:00
parent 05c088f158
commit 0de46888eb
2 changed files with 26 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
FROM golang:alpine as builder
RUN mkdir /build
ADD . /build/
WORKDIR /build
RUN apk add git gcc musl-dev
RUN go build -o ipe ./cmd
FROM alpine
USER root
RUN mkdir -p /config
RUN adduser -S -D -H -h /app appuser
COPY ./entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
USER appuser
WORKDIR /app
COPY --from=builder /build/ipe /app/
COPY --from=builder /build/config-example.yml /app/config-example.yml
VOLUME /config
CMD ["/bin/sh", "/app/entrypoint.sh"]
EXPOSE 4343
EXPOSE 8080
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
if [ -z "$(ls -A /config)" ]; then
cp /app/config-example.yml /config/config.yml
fi
/app/ipe --config=/config/config.yml