dev.Dockerfile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. FROM --platform=linux/arm64/v8 ubuntu:latest
  2. WORKDIR /app
  3. EXPOSE 80 443
  4. # COPY resources/development/sources.list /etc/apt/sources.list
  5. ENV GO_VERSION="1.21.4"
  6. ENV GO_ARCH="linux-arm64"
  7. ENV GO_TAR="go${GO_VERSION}.${GO_ARCH}.tar.gz"
  8. ENV PATH="${PATH}:/usr/local/go/bin"
  9. RUN set -x \
  10. # create nginx user/group first, to be consistent throughout docker variants
  11. && addgroup --system --gid 101 nginx \
  12. && adduser --system --disabled-login --ingroup nginx --no-create-home --home /nonexistent --gecos "nginx user" --shell /bin/false --uid 101 nginx \
  13. && apt update && apt install gcc curl gnupg2 ca-certificates lsb-release ubuntu-keyring wget -y \
  14. && curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
  15. | tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null \
  16. && echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
  17. http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
  18. | tee /etc/apt/sources.list.d/nginx.list
  19. RUN echo "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" | tee /etc/apt/preferences.d/99nginx \
  20. && apt update && apt install nginx -y
  21. RUN wget https://go.dev/dl/${GO_TAR} && \
  22. rm -rf /usr/local/go && tar -C /usr/local -xzf ${GO_TAR} && rm -f ${GO_TAR}
  23. RUN go install github.com/cosmtrek/air@latest
  24. COPY resources/development/entrypoint.sh /entrypoint.sh
  25. RUN chmod a+x /entrypoint.sh \
  26. && rm -f /etc/nginx/conf.d/default.conf \
  27. && rm -f /usr/etc/nginx/conf.d/default.conf
  28. CMD ["/entrypoint.sh"]