Refactor Docker setup and replace web files with new structure

This commit is contained in:
Lukian 2025-01-21 08:39:08 +01:00
parent 2e2ec0885c
commit f1d2a93752
5 changed files with 18 additions and 13 deletions

View file

@ -1,16 +1,22 @@
services: services:
webserver: webserver:
dockerfile: docker/apache2/dockerfile build: docker/apache2
build: .
ports: ports:
- "5000:5000" - 5000:5000
- 80:80
volumes: volumes:
- .:/code - .:/code
networks:
- mynetwork
attacker: attacker:
dockerfile: docker/attacker/dockerfile build: docker/attacker
build: .
ports: ports:
- "5001:5001" - 5001:5001
volumes: volumes:
- .:/code - .:/code
networks:
- mynetwork
networks:
mynetwork:
external: false

View file

@ -1,8 +1,7 @@
FROM ubuntu:lastest AS webserver FROM debian:stable-slim
RUN apt-get update && apt-get install -y apache2 RUN apt-get update \
&& apt-get install -y apache2 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /var/www/html WORKDIR /var/www/html
COPY ./public/ . COPY ./public/ .
CMD ["apache2ctl", "-D", "FOREGROUND"] CMD ["apache2ctl", "-D", "FOREGROUND"]

View file

@ -1,4 +1,4 @@
FROM alpine:latest AS attacker FROM alpine:latest
RUN apk add --no-cache curl RUN apk add --no-cache curl
CMD ["curl", "webserver:80"] CMD ["curl", "webserver:80"]