The architecture of my website
I just want to know how upto set up SSL to change the HTTP to HTTPS in my situation. I have tried to follow a few guidelines but still failed…
Is there any detailed instruction/steps to guide me to set up SSL in such env?
I run all my things in apache2.
already have a domain name.
Any help will be appreciated… Many thanks...
Short Answer
docker-compose.yml
and Dockerfile
files with required keywords and commands (port forwarding, naming, images, etc.)certbot
in it for Let's Encrypt SSL for you domaindocker-compose up -d --build
Long Answer
docker-file.yml
contents (read more in Compose Docs :
version: '3.9'
services:
ANY_NAME:
build: .
restart: always
ports:
- 8201:8080
- 8000:8101
SECOND_NAME: # if you need more containers, copy this part
build: .
restart: always
ports:
- PORT_BE_ACCESSED_IN_WEB:LOCAL_PORT
volumes:
SOME_NAME: {}
Docekrfile
contents (read more in Dockerfile Docs ):
FROM nginx:latest # or any other base:version you need
# Your other commands goes there
# Example:
COPY ./domain.conf /etc/apache2/sites-available/
RUN a2ensite domain
RUN service apache2 reload
RUN apt-get update
RUN apt-get install certbot -y
RUN certbot ... # see certbot docs for more info
ENTRYPOINT ["some", "commands"]
Then run this command and if nothing goes wrong, it should be fine:
docker-compose up -d --build
Now it should be accessible via http://your_server_ip:8201
and http://your_server_ip:8000
. If it's fine, then check https://your_server_ip:8201
and https://your_server_ip:8000
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.