adminer and ftp WIP
This commit is contained in:
parent
856ac6a99b
commit
63f9b5b9b0
4
Makefile
4
Makefile
@ -6,7 +6,7 @@
|
|||||||
# By: whaffman <whaffman@student.codam.nl> +#+ #
|
# By: whaffman <whaffman@student.codam.nl> +#+ #
|
||||||
# +#+ #
|
# +#+ #
|
||||||
# Created: 2025/05/12 15:33:56 by whaffman #+# #+# #
|
# Created: 2025/05/12 15:33:56 by whaffman #+# #+# #
|
||||||
# Updated: 2025/05/22 10:25:47 by whaffman ######## odam.nl #
|
# Updated: 2025/05/22 16:23:30 by whaffman ######## odam.nl #
|
||||||
# #
|
# #
|
||||||
# **************************************************************************** #
|
# **************************************************************************** #
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ DOCKER_COMPOSE = docker compose
|
|||||||
DOCKER_COMPOSE_FILE = ./srcs/docker-compose.yml
|
DOCKER_COMPOSE_FILE = ./srcs/docker-compose.yml
|
||||||
DOCKER_ENV_FILE = ./srcs/.env
|
DOCKER_ENV_FILE = ./srcs/.env
|
||||||
|
|
||||||
DATA_DIR = ./data
|
DATA_DIR = /home/whaffman/data
|
||||||
WORDPRESS_DATA_DIR = $(DATA_DIR)/wordpress
|
WORDPRESS_DATA_DIR = $(DATA_DIR)/wordpress
|
||||||
MARIADB_DATA_DIR = $(DATA_DIR)/mariadb
|
MARIADB_DATA_DIR = $(DATA_DIR)/mariadb
|
||||||
|
|
||||||
|
|||||||
@ -81,6 +81,26 @@ services:
|
|||||||
- docker-network
|
- docker-network
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
|
ftp:
|
||||||
|
container_name: ftp
|
||||||
|
image: ftp
|
||||||
|
build:
|
||||||
|
context: ./requirements/ftp
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
depends_on:
|
||||||
|
- wordpress
|
||||||
|
environment:
|
||||||
|
- FTP_USER=${FTP_USER}
|
||||||
|
- FTP_PASS=${FTP_PASS}
|
||||||
|
- FTP_PORT=${FTP_PORT}
|
||||||
|
networks:
|
||||||
|
- docker-network
|
||||||
|
ports:
|
||||||
|
- '21:21'
|
||||||
|
- '30000-30009:30000-30009'
|
||||||
|
volumes:
|
||||||
|
- data_wordpress:/var/www/html
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
docker-network:
|
docker-network:
|
||||||
@ -93,12 +113,12 @@ volumes:
|
|||||||
driver: local
|
driver: local
|
||||||
driver_opts:
|
driver_opts:
|
||||||
type: none
|
type: none
|
||||||
device: ../data/mariadb
|
device: /home/whaffman/data/mariadb
|
||||||
o: bind
|
o: bind
|
||||||
data_wordpress:
|
data_wordpress:
|
||||||
name: data_wordpress
|
name: data_wordpress
|
||||||
driver: local
|
driver: local
|
||||||
driver_opts:
|
driver_opts:
|
||||||
type: none
|
type: none
|
||||||
device: ../data/wordpress
|
device: /home/whaffman/data/wordpress
|
||||||
o: bind
|
o: bind
|
||||||
|
|||||||
16
srcs/requirements/adminer/Dockerfile
Normal file
16
srcs/requirements/adminer/Dockerfile
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
FROM alpine:3.20
|
||||||
|
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
php83 \
|
||||||
|
php83-fpm \
|
||||||
|
php83-mysqli \
|
||||||
|
php83-mbstring \
|
||||||
|
php83-session \
|
||||||
|
mariadb-client \
|
||||||
|
curl &&\
|
||||||
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
# Add a new user and group
|
||||||
|
# Create group with GID = HOST_UID, then user with UID = HOST_UID and GID = HOST_UID
|
||||||
|
ARG HOST_UID
|
||||||
|
|
||||||
17
srcs/requirements/ftp/Dockerfile
Normal file
17
srcs/requirements/ftp/Dockerfile
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
FROM alpine:3.20
|
||||||
|
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
vsftpd \
|
||||||
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
RUN adduser -D -h /home/ftpuser -s /bin/false ftpuser && \
|
||||||
|
echo "ftpuser:password" | chpasswd && \
|
||||||
|
mkdir -p /home/ftpuser/ftp && \
|
||||||
|
chmod 750 /home/ftpuser/ftp && \
|
||||||
|
chown -R ftpuser:ftpuser /home/ftpuser/ftp
|
||||||
|
|
||||||
|
COPY ./conf/vsftpd.conf /etc/vsftpd/vsftpd.conf
|
||||||
|
|
||||||
|
EXPOSE 20 21 30000-30009
|
||||||
|
|
||||||
|
CMD ["vsftpd", "/etc/vsftpd/vsftpd.conf"]
|
||||||
34
srcs/requirements/ftp/conf/vsftpd.conf
Normal file
34
srcs/requirements/ftp/conf/vsftpd.conf
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# Allow local users to log in
|
||||||
|
local_enable=YES
|
||||||
|
|
||||||
|
# Enable write permissions for local users
|
||||||
|
write_enable=YES
|
||||||
|
|
||||||
|
# Restrict users to their home directories
|
||||||
|
chroot_local_user=YES
|
||||||
|
|
||||||
|
# Enable passive mode (useful for NAT and firewalls)
|
||||||
|
pasv_enable=YES
|
||||||
|
pasv_min_port=30000
|
||||||
|
pasv_max_port=30009
|
||||||
|
|
||||||
|
# Disable anonymous login
|
||||||
|
anonymous_enable=NO
|
||||||
|
|
||||||
|
# Set the FTP banner message
|
||||||
|
ftpd_banner=Welcome to the FTP server.
|
||||||
|
|
||||||
|
# Listen on IPv4
|
||||||
|
listen=YES
|
||||||
|
|
||||||
|
# Disable IPv6 (optional, if not needed)
|
||||||
|
listen_ipv6=NO
|
||||||
|
|
||||||
|
# Set the maximum number of clients
|
||||||
|
max_clients=10
|
||||||
|
|
||||||
|
# Set the maximum number of connections per IP
|
||||||
|
max_per_ip=5
|
||||||
|
|
||||||
|
# Log all FTP requests
|
||||||
|
xferlog_enable=YES
|
||||||
1
srcs/requirements/ftp/tools/docker-entrypoint.sh
Normal file
1
srcs/requirements/ftp/tools/docker-entrypoint.sh
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
||||||
@ -6,11 +6,6 @@ RUN apk add --no-cache \
|
|||||||
redis && \
|
redis && \
|
||||||
rm -rf /var/cache/apk/*
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
ARG HOST_UID
|
|
||||||
|
|
||||||
# Expose the default Redis port
|
|
||||||
EXPOSE 6379
|
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user