Upload files to "/"
This commit is contained in:
+65
-22
@@ -1,32 +1,75 @@
|
|||||||
# Image de référence
|
# Only the instructions RUN, COPY, ADD create layers
|
||||||
|
|
||||||
|
# Reference image
|
||||||
FROM ubuntu:latest
|
FROM ubuntu:latest
|
||||||
|
|
||||||
# Données méta
|
# Meta data (OCI standard)
|
||||||
LABEL org.opencontainers.image.title="Serveur Apache"
|
LABEL org.opencontainers.image.title="My image"
|
||||||
LABEL org.opencontainers.image.version="1"
|
LABEL org.opencontainers.image.description="My description"
|
||||||
LABEL org.opencontainers.image.revision="0"
|
LABEL org.opencontainers.image.authors="Pierre ROYER <mail@pierreau.fr>"
|
||||||
LABEL environment="formation"
|
LABEL org.opencontainers.image.url="https://pierreau.fr/pro/"
|
||||||
|
LABEL org.opencontainers.image.version="2"
|
||||||
|
LABEL org.opencontainers.image.revision="1"
|
||||||
|
LABEL org.opencontainers.image.created="2016-11-28T15:00:00+02:00" # UTC+2 (rfc3339)
|
||||||
|
# Meta data (not standard)
|
||||||
|
LABEL Environment="production" Site="Nantes"
|
||||||
|
|
||||||
|
# Installing packages without interruption (Debian)
|
||||||
|
# ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# Commands executed during image creation
|
||||||
|
# Change mirror source for best performances
|
||||||
|
RUN sed -i 's/ports.ubuntu.com/fr.ports.ubuntu.com/' /etc/apt/sources.list.d/ubuntu.sources
|
||||||
|
|
||||||
# Commandes exécuteés pendant la création de l’image
|
|
||||||
RUN apt-get update && apt-get upgrade -y
|
RUN apt-get update && apt-get upgrade -y
|
||||||
RUN apt install -y apache2
|
RUN apt install -y --no-install-recommends \
|
||||||
RUN apt-get clean ; rm -rf /var/lib/apt/lists/*
|
apache2 \
|
||||||
|
cron \
|
||||||
|
curl \
|
||||||
|
openssh-server \
|
||||||
|
tzdata \
|
||||||
|
vim \
|
||||||
|
wget
|
||||||
|
|
||||||
# Configuration Apache
|
# Remove unnecessary files to optimize image size
|
||||||
RUN echo 'ServerName apache.formation.fr:80' >> /etc/apache2/apache2.conf
|
RUN apt clean ; rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Spécifier de répertoire courant
|
# Setup time zone
|
||||||
WORKDIR /var/www/html/
|
ENV TZ=Europe/Paris
|
||||||
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
RUN dpkg-reconfigure --frontend noninteractive tzdata
|
||||||
|
|
||||||
# Copie du fichier host vers le conteneur
|
# Apache configuration
|
||||||
RUN mv index.html index.html.old
|
RUN echo 'ServerName apache.pierreau.fr:80' >> /etc/apache2/apache2.conf
|
||||||
COPY index.html .
|
|
||||||
|
|
||||||
# Commande lancée au démarrage du conteneur
|
# Copying files from host to container
|
||||||
# CMD ["/usr/sbin/apachectl", "-D", "FOREGROUND"]
|
# RUN cd /var/www/html/
|
||||||
|
# RUN mv index.html index.html.old
|
||||||
|
# COPY index.html /var/www/html/
|
||||||
|
|
||||||
# Vérifie l’état de santé (pour un serveur web)
|
# RUN wget https://cloud.pierreau.fr/index.html
|
||||||
# HEALTHCHECK --start-period=30s --interval=1m --timeout=2s --retries=5 CMD curl -f http://localhost/ || exit 1
|
|
||||||
|
|
||||||
# Port réseau utilisé
|
# Allows adding URLs or archives
|
||||||
EXPOSE 80/tcp
|
ADD https://cloud.pierreau.fr/index.html .
|
||||||
|
|
||||||
|
# Mount points created in container
|
||||||
|
VOLUME ["/var/www/html", "/etc/apache2", "/var/log/apache2/"]
|
||||||
|
|
||||||
|
# Adding a user
|
||||||
|
RUN useradd -m -s /bin/bash -p M0t2P@$$ sshuser
|
||||||
|
USER sshuser
|
||||||
|
# Specifies default directory
|
||||||
|
WORKDIR /home/sshuser
|
||||||
|
RUN echo "df -h" > .profile
|
||||||
|
USER root
|
||||||
|
|
||||||
|
# ENTRYPOINT command (not overridable by docker run) launched at container startup
|
||||||
|
# COPY docker-entrypoint.sh /root/
|
||||||
|
# RUN chmod 700 /root/docker-entrypoint.sh
|
||||||
|
# ENTRYPOINT ["/root/docker-entrypoint.sh"]
|
||||||
|
|
||||||
|
# Command (overloadable by docker run) launched when the container starts
|
||||||
|
CMD ["/usr/sbin/apachectl", "-D", "FOREGROUND"]
|
||||||
|
|
||||||
|
# For information purposes, specifies the ports/protocols used
|
||||||
|
EXPOSE 80 22/tcp 123/udp
|
||||||
|
|||||||
+48
-38
@@ -1,42 +1,52 @@
|
|||||||
|
version: '3.7'
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
Postgres-Data:
|
||||||
|
name: Postgres-Data
|
||||||
|
|
||||||
services:
|
services:
|
||||||
netdata:
|
postgres:
|
||||||
image: netdata/netdata
|
image: postgres:latest
|
||||||
container_name: netdata
|
pull_policy: always
|
||||||
|
container_name: pierreau.postgres
|
||||||
ports:
|
hostname: postgres
|
||||||
- 19999:19999
|
restart: always
|
||||||
# PGID is obtained with: grep docker /etc/group | cut -d ':' -f 3
|
# ports:
|
||||||
|
# - "5432:5432"
|
||||||
|
expose:
|
||||||
|
- 5432
|
||||||
environment:
|
environment:
|
||||||
- PGID=120
|
- POSTGRES_USER=PostgresUser
|
||||||
memswap_limit: 256M
|
- POSTGRES_PASSWORD=PostgresPWD
|
||||||
deploy:
|
- POSTGRES_DB=PostgresDBname
|
||||||
resources:
|
- TZ=Europe/Paris
|
||||||
reservations:
|
|
||||||
cpus: '0.2'
|
|
||||||
memory: 128M
|
|
||||||
limits:
|
|
||||||
cpus: '0.5'
|
|
||||||
memory: 256M
|
|
||||||
restart: on-failure
|
|
||||||
cap_add:
|
|
||||||
- SYS_PTRACE
|
|
||||||
security_opt:
|
|
||||||
- apparmor:unconfined
|
|
||||||
volumes:
|
volumes:
|
||||||
- netdataconfig:/etc/netdata
|
- Postgres-Data:/var/lib/postgresql/data
|
||||||
- netdatalib:/var/lib/netdata
|
- /etc/localtime:/etc/localtime:ro
|
||||||
- netdatacache:/var/cache/netdata
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
- /etc/passwd:/host/etc/passwd:ro
|
|
||||||
- /etc/group:/host/etc/group:ro
|
|
||||||
- /proc:/host/proc:ro
|
|
||||||
- /sys:/host/sys:ro
|
|
||||||
- /etc/os-release:/host/etc/os-release:ro
|
|
||||||
|
|
||||||
volumes:
|
pgadmin:
|
||||||
netdataconfig:
|
image: dpage/pgadmin4
|
||||||
name: netdata-config
|
container_name: pierreau.pgadmin
|
||||||
netdatalib:
|
depends_on:
|
||||||
name: netdata-lib
|
- postgres
|
||||||
netdatacache:
|
restart: on-failure
|
||||||
name: netdata-cache
|
ports:
|
||||||
|
- "55320:80"
|
||||||
|
environment:
|
||||||
|
PGADMIN_DEFAULT_EMAIL: user@pierreau.fr
|
||||||
|
PGADMIN_DEFAULT_PASSWORD: SuperSecret
|
||||||
|
|
||||||
|
adminer:
|
||||||
|
image: adminer:latest
|
||||||
|
container_name: pierreau.adminer
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
restart: on-failure
|
||||||
|
environment:
|
||||||
|
ADMINER_DEFAULT_DB_DRIVER: postgresql
|
||||||
|
ADMINER_DEFAULT_SERVER: pierreau.postgres
|
||||||
|
ADMINER_DEFAULT_DB_NAME: PostgresDBname
|
||||||
|
ADMINER_PLUGINS: dump-zip dump-bz2 dump-date
|
||||||
|
ADMINER_DESIGN: galkaev # nette
|
||||||
|
ports:
|
||||||
|
- "55321:8080"
|
||||||
|
|||||||
Reference in New Issue
Block a user