Coder Social home page Coder Social logo

docker-symfony's Introduction

Docker-symfony

(Docker image ready to use)

This docker image is tested for symfony 3 and 4 projects along with other database supporting docker images such as mysql:5.7, phpmyadmin/phpmyadmin

Image tags reference : theva/docker-symfony

How to use

Simple usage (without ssl)

  1. Create your docker-compose.yml as simple as you see in docker-symfony/docker-compose/simple/docker-compose.yml

  2. Execute docker-compose.yml in the terminal

    docker-compose up -d --build
    
  3. if there is no build error and if the containers are created, then you can access your site at http://app.local

Enable SSL

if you are need of your docker container (local server) be supported for ssl, follow these steps

  1. Add these files somewhere in to your project directory

    1. docker-symfony/certs/cert.key
    2. docker-symfony/certs/cert.pem
    3. docker-symfony/conf/app.conf
  2. Change these lines in the file conf/app.conf according to your project

    • ServerName app.local ##line-2
    • DocumentRoot /var/www/public ##line-3
    • <Directory "/var/www/public"> ##line-10
    • DocumentRoot /var/www/public ##line-24
  3. Create a Dockerfile and use theva/docker-symfony as base image Add some additional commands

    Sample Dockerfile looks like
    FROM theva/docker-symfony
    
    WORKDIR /var/www
    RUN mkdir -p /etc/apache2/external
    
    COPY $FILE_PATH/certs/*  /etc/apache2/external/
    COPY $FILE_PATH/conf/* /etc/apache2/sites-enabled/
     
    RUN rm /etc/apache2/sites-enabled/000-default.conf
    RUN a2enmod ssl  #enable ssl
    
    EXPOSE 80
    EXPOSE 443
    
  4. Create your docker-compose.yml as you see in docker-symfony/docker-compose/ssl/docker-compose.yml

  5. Execute docker-compose.yml in the terminal

       docker-compose up -d --build
    
  6. if there is no build error and if the containers are created, then you can access your site at https://app.local or http://app.local

docker-symfony's People

Contributors

latheva avatar

Watchers

James Cloos avatar

docker-symfony's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.