Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Magento 1 projects #39

Open
u-maxx opened this issue May 22, 2019 · 3 comments
Open

Add support for Magento 1 projects #39

u-maxx opened this issue May 22, 2019 · 3 comments
Assignees
Labels

Comments

@u-maxx
Copy link
Member

u-maxx commented May 22, 2019

Add support for Magento 1 projects

@u-maxx u-maxx self-assigned this May 25, 2019
@atishgoswami
Copy link

Recently used the project to setup Magento 1.14 site on my local.

Had to do a couple of changes and the setup manually, but it did work.

docker-compose.yml

version: "3"

services:

  app:
    image: mage2click/magento-nginx:1.15-alpine
    ports:
      - "80:8000"
      - "443:8443"
    depends_on:
      - db
      - phpfpm
    volumes: &appvolumes
      - ~/.composer:/var/www/.composer:delegated
      - appdata:/var/www/html
      - sockdata:/sock

  db:
    image: percona:5.7
    ports:
      - "3306:3306"
    env_file: env/db.env
    volumes:
      - dbdata:/var/lib/mysql

  phpfpm:
    image: mage2click/magento-php-versions:5.6-fpm
    depends_on:
      - db
    volumes: *appvolumes

volumes:
  appdata:
  dbdata:
  sockdata:

nginx.conf

root $MAGE_ROOT;

client_body_buffer_size 8k;
client_max_body_size 10M;
client_header_buffer_size 1k;
large_client_header_buffers 4 16k;

if ($server_port = 80) { set $httpss off; }

location /
{
    index index.html index.php; ## Allow a static html file to be shown first
    try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
    expires 30d; ## Assume all files are cachable
}

## These locations would be hidden by .htaccess normally
location /app/                { deny all; }
location /includes/           { deny all; }
location /lib/                { deny all; }
location /media/downloadable/ { deny all; }
location /pkginfo/            { deny all; }
location /report/config.xml   { deny all; }
location /var/                { deny all; }

## Disable .htaccess and other hidden files
location  /.
{
    return 404;
}

## Magento uses a common front handler
location @handler
{
    rewrite / /index.php;
}

## Forward paths like /js/index.php/x.js to relevant handler
location ~ .php/
{
    rewrite ^(.*.php)/ $1 last;
}

## Execute PHP scripts
location ~ .php$
{
    ## Catch 404s that try_files miss
    if (!-e $request_filename) {
        rewrite / /index.php last;
    }

    expires off; ## Do not cache dynamic content
    fastcgi_pass fastcgi_backend;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #fastcgi_read_timeout 1500;
    fastcgi_param MAGE_RUN_CODE default; ## Store code is defined in administration > Configuration > Manage Stores
    fastcgi_param MAGE_RUN_TYPE store;
    fastcgi_param HTTPS on;
    fastcgi_param HTTP_X_FORWARDED_PROTO https;
    fastcgi_buffer_size 32k;
    fastcgi_buffers 4 32k;
    include fastcgi_params; ## See /etc/nginx/fastcgi_params
    fastcgi_param SERVER_PORT 443;
}

Had to change the mutagen sync configs as well and removed the vendor sync

bin/mutagen

mutagen create \
        --label=mage2click-sync=html \
        --default-file-mode=0644 \
        --default-directory-mode=0755 \
        --default-owner-beta=app \
        --default-group-beta=app \
        --sync-mode=two-way-resolved \
        --ignore=/.idea \
        --ignore-vcs \
        ${CONTAINER_SRC_SYNC_DIR}/app docker://$(docker-compose ps -q phpfpm|awk '{print $1}')/var/www/html/app/

Hope it helps someone, trying to setup M1 on there local using the project

@shkoliar
Copy link
Member

shkoliar commented Oct 7, 2019

Hey @atishgoswami,

Check also feature/magento-1 branch and M1.md for setup information 😉

@atishgoswami
Copy link

Silly me, should have checked the branches.

Will test it out thanks @shkoliar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants