23 lines
666 B
Docker
23 lines
666 B
Docker
# Use Ubuntu 22.04 as the base image
|
|
FROM ubuntu:22.04
|
|
|
|
# Set environment variables for non-interactive installation
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# Update the package index
|
|
RUN apt-get update
|
|
|
|
# Install cloud-init and locales
|
|
RUN apt-get install -y cloud-init locales
|
|
|
|
# Add the cloud-init file to the container
|
|
COPY sbcl-nginx.yml /root/sbcl-nginx.yml
|
|
|
|
# Run the cloud-init configuration
|
|
RUN cloud-init single --file /root/sbcl-nginx.yml --name runcmd
|
|
|
|
# Expose ports for SSH, HTTP, and HTTPS
|
|
EXPOSE 22 80 443
|
|
|
|
# Run the CMD to start the services (SSH, nginx, and fail2ban)
|
|
CMD service ssh start && service nginx start && service fail2ban start && /bin/bash
|