Giter Site home page Giter Site logo

osteel / docker-tutorial Goto Github PK

View Code? Open in Web Editor NEW
160.0 160.0 56.0 5.81 MB

Companion repository for a tutorial series about using Docker locally for web development

Home Page: https://tech.osteel.me/posts/docker-for-local-web-development-introduction-why-should-you-care

License: MIT License

PHP 95.95% Dockerfile 4.05%
docker docker-compose laravel php webdevelopment

docker-tutorial's Introduction

Demat ! ๐Ÿ‘‹

I'm Yannick, a senior backend developer based in Brighton, UK.

You might want to have a look at my Docker for local web development series, whose repository is my most popular one.

Here's what I've been publishing on my blog lately (you can also follow me on Twitter for more content):

I also work as an independent contractor โ€“ you might want to check out my CV and reach out on LinkedIn.

docker-tutorial's People

Contributors

osteel avatar philintv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-tutorial's Issues

phpmyadmin.test doesnt seem to work with https...

I came across the error right after we installed the certificates...
when i entered phpmyadmin.test it was showing up as not secured.

changed the server_name to phpmyadmin.demo.test and restarted the container...

Works like it should work now :)

hope this helps out some others

Where do I ask questions about specific setup's?

Hi @osteel. Let me first thank you for this Docker tutorial. I am using it for over a year now for my local development, but never got around to make an attempt to getting to know it. This tutorial series is an excellent starting point.

I have a specific setup I still don't know how to setup. I am also somewhat of a paranoia dinosaur and don't use social media. You either have no e-mail or prefer not to share the address with the public, understandably so. So my question is if you are available for advice in specific situations and if so, where do I ask my questions?

Slackbot + Docker + ngrok results in Dispatch_failed

Hi @osteel, I wanted some inputs from you regarding Docker + ngrok as I am stuck and don't know how to proceed further.

Tl;Dr Docker running in one terminal, fails to listen/recognize ngrok's url running on another terminal. How to make Docker listen to ngrok?

Running the slackbot (built in python + flask) within PyCharm works fine, as in commands are executed and payloads/modals are being sent received. And so does running the command gunicorn --bind 0.0.0.0:5000 wsgi:flaskApp -w 4 within PyCharm's termnal (Please note, ngrok is running on mac's terminal via ./ngrok http 5000). The url in "Interactivity & Shortcuts" AND "Slash Commands" both point to https://...ngrok.io/slack/events. Again, the app, the commands, ngrok, everything works fine.

But when I move the slack app to within Docker and start Docker up with docker-compose up --build which in turns runs ENTRYPOINT ["gunicorn", "--bind", "0.0.0.0:5000", "wsgi:flaskApp", "--workers", "4"], the slackbot fails with dispatch_failed when a command is executed and ngrok terminal shows 502 Bad Gateway. The docker command/image, itself runs fine without any errors, but for some reason it isn't able to recognize the url exposed by ngrok. Any ideas what's wrong?

Dockerfile

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

WORKDIR /app

COPY requirements.txt ./

COPY Main.py wsgi.py EmailSender.py AppConfig.py CompareCopyFgData.py SlackPayload.py Queries.py ./

RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt

ENV FLASK_APP=Main.py
ENV FLASK_ENV=production

ENTRYPOINT ["gunicorn", "--bind", "0.0.0.0:5000", "wsgi:flaskApp", "--workers", "4"]

docker-compose.yml

version: "3.9"
services:
  slackbot:
    build: 
      context: App/
      dockerfile: Dockerfile
    env_file:
      - ./App/.env

Steps to reproduce:

  1. Start ngrok in a terminal using ngrok http 5000
  2. Set up docker-compose.yml and Dockerfile with the appropriate files and run commands
  3. In a new terminal, point to the folder containing docker-compose.yml image and run command docker-compose up --build
  4. If no errors, go to slack and run a slash command and wait to see logs in Docker Terminal window

Expected result:

Docker to accept incoming slack commands and print logs, send modal(s) to slack and receive user inputs etc

Actual result:

Nothing happens in docker. The 4 workers are started and keep waiting/listening for a payload/data to come in, even though ngrok is running.

Screen Shot 2022-05-01 at 2 17 27 PM

Screen Shot 2022-05-01 at 2 17 45 PM

Proxy error

Hi there,

I received a proxy error like this:
Proxy error: Could not proxy request /api/login from frontend.demo.test to http://backend.demo.test/. frontend_1 | See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).

Help me, please. Thanks!

version error

following your first part of this tut iget this error, when adding mysql:

ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

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.