Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build for linux/arm64/v8 #61

Open
mrdziuban opened this issue Apr 11, 2023 · 1 comment
Open

Build for linux/arm64/v8 #61

mrdziuban opened this issue Apr 11, 2023 · 1 comment

Comments

@mrdziuban
Copy link

Hello, thank you for your work on this project! I find it by far the simplest way to manage my web servers. I wondered if it would be possible to build the docker image for linux/arm64/v8? It looks like the base image (openresty/openresty:alpine-fat) image is available for this architecture so I'm hoping it would be straightforward. Thanks in advance!

@mick-net
Copy link

mick-net commented Feb 2, 2024

I've had the same issue. The following made it work for me to run it on an ARM64 server

docker-compose:

nginx:
    build:
      context: ./src/nginx-auto-ssl
      dockerfile: Dockerfile
    env_file:
      - .env
    depends_on:
      - web
    restart: on-failure
    ports:
      - 80:80
      - 443:443
    volumes:
      - ssl-data:/etc/resty-auto-ssl
    environment:
      ALLOWED_DOMAINS: '${DOMAIN}'
      SITES: '${DOMAIN}=web:8000'

Dockerfile:

FROM openresty/openresty:1.19.9.1-12-bionic-aarch64

# allowed domains should be lua match pattern
ENV DIFFIE_HELLMAN='' \
    ALLOWED_DOMAINS='.*' \
    AUTO_SSL_VERSION='0.13.1' \
    FORCE_HTTPS='true' \
    SITES='' \
    LETSENCRYPT_URL='https://acme-v02.api.letsencrypt.org/directory' \
    STORAGE_ADAPTER='file' \
    REDIS_HOST='' \
    REDIS_PORT='6379' \
    REDIS_DB='0' \
    REDIS_KEY_PREFIX='' \
    RESOLVER_ADDRESS='8.8.8.8'

# Update and install packages using apt instead of apk
RUN apt-get update && apt-get install -y bash openssl \
    && /usr/local/openresty/luajit/bin/luarocks install lua-resty-auto-ssl $AUTO_SSL_VERSION \
    && openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 \
    -subj '/CN=sni-support-required-for-valid-ssl' \
    -keyout /etc/ssl/resty-auto-ssl-fallback.key \
    -out /etc/ssl/resty-auto-ssl-fallback.crt \
    && openssl dhparam -out /usr/local/openresty/nginx/conf/dhparam.pem 2048 \
    && rm /etc/nginx/conf.d/default.conf

COPY nginx.conf snippets /usr/local/openresty/nginx/conf/
COPY entrypoint.sh /entrypoint.sh

VOLUME /etc/resty-auto-ssl

ENTRYPOINT ["/entrypoint.sh"]
CMD ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants