I am fairly new to this so I will try to include all pertinent info, and please forgive what is probably a very obvious a silly thing that I've missed. I have a golang docker container which my app is built in and am trying to install an SSL certificate. I am using the golang:1.16-alpine image for my app.
Here is my Dockerfile:
# syntax=docker/dockerfile:1
FROM golang:1.16-alpine
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY * ./
COPY templates/* ./templates/
RUN go build -o /docker-gs-ping
RUN apk add python3 python3-dev py3-pip build-base libressl-dev musl-dev libffi-dev rust cargo
RUN pip3 install pip --upgrade
RUN pip3 install certbot-nginx
RUN mkdir /etc/letsencrypt
EXPOSE 8080
CMD [ "/docker-gs-ping" ]
Here is my docker-compose.yml:
version: "3.4"
services:
phpmyadmin:
image: phpmyadmin/phpmyadmin
environment:
- PMA_ARBITRARY=1
- PMA_HOST=db
- PMA_PORT=3306
restart: always
ports:
- 8081:8081
volumes:
- /sessions
depends_on:
- db
db:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: ah83is82js95pq
MYSQL_DATABASE: northernairport
ports:
- "3306:3306"
volumes:
- ./data:/docker-entrypoint-initdb.d
restart: always
app:
container_name: NorthernAirport
build:
dockerfile: Dockerfile
context: .
ports:
- "80:80"
- "443:443"
restart: always
volumes:
- ./public:/var/www/html
Finally my nginx.conf:
server {
listen 80;
server_name northernair.xyz;
location / {
root /app;
index index.gohtml;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
My domain is:
northernair.xyz
I ran this command:
docker-compose up
It produced this output:
the certbot service fails:
certbot_1 | Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
certbot_1 | Domain: northernair.xyz
certbot_1 | Type: connection
certbot_1 | Detail: Fetching http://northernair.xyz/.well-known/acme-challenge/83JtXGlU7qqx7hKaJ1W5YkNBJSvmMmb4RyITNR_q3Yo: Connection refused
My web server is (include version):
golang1.16-alpine docker image
The operating system my web server runs on is (include version):
Ubuntu
My hosting provider, if applicable, is:
Digital Ocean
I can login to a root shell on my machine (yes or no, or I don't know):
yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
no
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot):
not sure how to complete this within my container but I see this output in when building:
certbot-1.24.0-py3-none-any.whl