Compare commits
3 Commits
b6c090c719
...
108b9ed752
Author | SHA1 | Date | |
---|---|---|---|
|
108b9ed752 | ||
|
c38b3da07e | ||
|
42400e7c50 |
30
docker-compose-proxy.yml
Normal file
30
docker-compose-proxy.yml
Normal file
@ -0,0 +1,30 @@
|
||||
version: "3"
|
||||
services:
|
||||
app:
|
||||
image: app:slim
|
||||
build: app
|
||||
expose:
|
||||
- "5000"
|
||||
ports:
|
||||
- "5000:5000"
|
||||
networks:
|
||||
webnet:
|
||||
aliases:
|
||||
- app
|
||||
|
||||
webserver:
|
||||
image: webserver:proxy
|
||||
build: webserver
|
||||
expose:
|
||||
- "80"
|
||||
ports:
|
||||
- "80:80"
|
||||
networks:
|
||||
webnet:
|
||||
aliases:
|
||||
- www
|
||||
depends_on:
|
||||
- app
|
||||
|
||||
networks:
|
||||
webnet:
|
@ -17,10 +17,8 @@ services:
|
||||
build: webserver
|
||||
expose:
|
||||
- "80"
|
||||
- "443"
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
networks:
|
||||
webnet:
|
||||
aliases:
|
||||
|
8
webserver/000-default.conf
Normal file
8
webserver/000-default.conf
Normal file
@ -0,0 +1,8 @@
|
||||
<VirtualHost *:80>
|
||||
ServerAdmin webmaster@localhost
|
||||
DocumentRoot /var/www/html
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||
ProxyPass / http://app:5000/
|
||||
</VirtualHost>
|
18
webserver/Dockerfile.proxy
Normal file
18
webserver/Dockerfile.proxy
Normal file
@ -0,0 +1,18 @@
|
||||
FROM debian:12-slim
|
||||
RUN apt update
|
||||
RUN apt install apache2 -y
|
||||
RUN a2enmod proxy_http
|
||||
RUN a2dissite 000-default
|
||||
COPY index.html /var/www/html
|
||||
COPY 000-default.conf /etc/apache2/sites-available
|
||||
RUN a2ensite 000-default
|
||||
EXPOSE 80
|
||||
RUN mkdir -p /var/run/apache2 &&\
|
||||
chown www-data:www-data /var/run/apache2
|
||||
ENV APACHE_RUN_DIR /var/run/apache2
|
||||
ENV APACHE_PID_FILE /var/run/apache2.pid
|
||||
ENV APACHE_RUN_USER www-data
|
||||
ENV APACHE_RUN_GROUP www-data
|
||||
ENV APACHE_LOG_DIR /var/log/apache2
|
||||
ENV APACHE_SERVER_NAME localhost
|
||||
CMD ["/usr/sbin/apache2ctl", "-DFOREGROUND"]
|
Loading…
Reference in New Issue
Block a user