Voltei
This commit is contained in:
20
Dockerfile
20
Dockerfile
@@ -32,21 +32,23 @@ RUN echo "DirectoryIndex login.php index.php" > /etc/apache2/conf-available/dire
|
|||||||
COPY app.zip /var/www/html/
|
COPY app.zip /var/www/html/
|
||||||
RUN unzip -o app.zip -d /var/www/html && rm app.zip
|
RUN unzip -o app.zip -d /var/www/html && rm app.zip
|
||||||
|
|
||||||
# NÃO remove ou cria link simbólico aqui — volume ainda não está montado no build!
|
# Remove diretório 'files' criado pelo zip e cria link simbólico para o volume
|
||||||
|
RUN rm -rf /var/www/html/files && ln -s /files /var/www/html/files
|
||||||
|
|
||||||
# Copia o files.zip (para uso manual ou por script)
|
# Copia o files.zip para o container (caso queira descompactar manualmente)
|
||||||
# COPY files.zip /files.zip
|
# COPY files.zip /files.zip
|
||||||
|
|
||||||
# Copia o entrypoint que cuida do link simbólico e permissões
|
# Ajusta permissões da aplicação
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
|
||||||
RUN chmod +x /entrypoint.sh
|
|
||||||
|
|
||||||
# Ajusta permissões da aplicação (não toca no volume /files!)
|
|
||||||
RUN chown -R www-data:www-data /var/www/html
|
RUN chown -R www-data:www-data /var/www/html
|
||||||
|
|
||||||
# Expõe a porta 80
|
# Expõe a porta 80
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
# Inicializa Apache via entrypoint personalizado
|
# Inicializa o Apache em foreground
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
||||||
CMD ["apache2-foreground"]
|
CMD ["apache2-foreground"]
|
||||||
|
|
||||||
|
# Ajusta permissões do volume montado
|
||||||
|
# PERMISSÕES DAPASTA
|
||||||
|
# chown -R www-data:www-data /files
|
||||||
|
# chmod -R 775 /files
|
||||||
|
# unzip -o /files.zip -d /files/
|
||||||
Reference in New Issue
Block a user