Skip to content

Instantly share code, notes, and snippets.

@skhatri
Created June 24, 2020 12:38
Show Gist options
  • Save skhatri/c7d8ff3882f16efb24c8e7fc907b265a to your computer and use it in GitHub Desktop.
Save skhatri/c7d8ff3882f16efb24c8e7fc907b265a to your computer and use it in GitHub Desktop.

Revisions

  1. skhatri created this gist Jun 24, 2020.
    17 changes: 17 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    FROM azul/zulu-openjdk-alpine:11.0.7
    LABEL base=alpine engine=jvm version=java11 timezone=UTC port=8080 dir=/opt/app user=app

    RUN apk update && apk add --no-cache tzdata curl bash && rm -rf /var/cache/apk/*
    ENV TZ=UTC
    RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

    EXPOSE 8080

    RUN mkdir -p /opt/app && ln -s /opt/app /lib

    WORKDIR /opt/app

    RUN addgroup -g 1000 -S app && adduser -u 1000 -G app -S app \
    && chown -R app:app /opt/app

    USER app