I created an environment for Masonite, a Python web framework similar to Laravel, with Docker!

Purpose

By creating the operating environment of Masonite, a Python web framework similar to Laravel, using Docker, we have made it available for joint development.

Operating environment

Mac: Catalina10.15.5 Docker: 19.03.8

Environment construction method and startup method

Create a Dockerfile and data directory with the following contents in the working directory.

FROM ubuntu:latest

COPY ./requirements.txt /opt

RUN apt-get update && apt-get -y upgrade && \
    apt-get install tzdata language-pack-ja gcc libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6 wget -y && \
    wget -P /opt https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
    bash /opt/Miniconda3-latest-Linux-x86_64.sh -b -p /opt/anaconda3 && \
    rm /opt/Miniconda3-latest-Linux-x86_64.sh && \
    echo "export PATH=/opt/anaconda3/bin:$PATH" >> ~/.bashrc && \
    . ~/.bashrc && \
    conda init && \
    pip install -r /opt/requirements.txt

ENV TZ Asia/Tokyo
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja
ENV LC_ALL ja_JP.UTF-8

RUN rm /opt/requirements.txt
RUN mkdir /opt/myproject

Also, create the following requirements.txt.

masonite

At this stage, the directory structure is as follows.

.
├── Dockerfile
├── data
└── requirements.txt

Build the Docker image and start the container.

docker build . -t masonite
docker run -v $(pwd)/data:/opt/myproject -p 8000:8000  -it masonite /bin/bash

Go to the / opt / myproject directory and create a Masonite application.

cd /opt/myproject
craft new

Start the build-in server.

craft serve -h 0.0.0.0 -r

Also, when you want to start the Docker container again, move to / opt / myproject and start the following command.

craft install

References

Set timezone with Ubuntu-based Docker

Recommended Posts

I created an environment for Masonite, a Python web framework similar to Laravel, with Docker!
I tried to build an environment for machine learning with Python (Mac OS X)
I made a development environment for Django 3.0 with Docker, Docker-compose, Poetry
I made a scaffolding tool for the Python web framework Bottle
I created an Anaconda environment using Docker!
I want to build a Python environment
Run a Python web application with Docker
Let's make a web framework with Python! (1)
Let's make a web framework with Python! (2)
I made a Docker container to use JUMAN ++, KNP, python (for pyKNP).
I was addicted to creating a Python venv environment with VS Code
Prepare an environment to touch grib2 format files with python (Docker edition)
Environment maintenance made with Docker (I want to post-process GrADS in Python
I tried to build a Mac Python development environment with pythonz + direnv
An introduction to self-made Python web applications for a sluggish third-year web engineer
Building an Anaconda environment for Python with pyenv
Introduction to Tornado (1): Python web framework started with Tornado
I want to make a game with Python
Start a simple Python web server with Docker
I created a Dockerfile for Django's development environment
Commands for creating a python3 environment with virtualenv
I want to write to a file with Python
I want to create a nice Python development environment for my new Mac
Notes from installing Homebrew to building an Anaconda environment for Python with pyenv
When I tried to create a virtual environment with Python, it didn't work
[ES Lab] I tried to develop a WEB application with Python and Flask ②
I searched for the skills needed to become a web engineer in Python
Searching for an efficient way to write a Dockerfile in Python with poetry
Build a local development environment with WSL + Docker Desktop for Windows + docker-lambda + Python
[Python] How to create a local web server environment with SimpleHTTPServer and CGIHTTPServer
I tried to draw a route map with Python
Build a python environment for each directory with pyenv-virtualenv
[Linux] WSL2 Build an environment for laravel7 with Ubuntu 20.04
I made a Python3 environment on Ubuntu with direnv.
Launch a Python web application with Nginx + Gunicorn with Docker
How to build a Django (python) environment on docker
I tried to implement an artificial perceptron with python
Building an environment for natural language processing with Python
I want to work with a robot in python.
[Go + Gin] I tried to build a Docker environment
I tried to automatically generate a password with Python3
Create a Layer for AWS Lambda Python with Docker
I want to run a quantum computer with Python
Deploy a web app created with Streamlit to Heroku
[Python] I want to use only index when looping a list with a for statement
I tried to build an environment with WSL + Ubuntu + VS Code in a Windows environment
I tried to create a reinforcement learning environment for Othello with Open AI gym
[Building a CI environment in 2 hours] Procedure for building a Python Web server with CircleCI and passing an HTTP communication test
Try running python in a Django environment created with pipenv
[Memo for Flask] An amateur who does not understand HTML or Web construction tries to create a Web service with Python + Flask
How to convert an array to a dictionary with Python [Application]
[Memo] Build a development environment for Django + Nuxt.js with Docker
I made a package to filter time series with python
I wrote a program quickly to study DI with Python ①
I want to start a jupyter environment with one command
I want to set up a GUI development environment with Python or Golang on Mac
Experiment to make a self-catering PDF for Kindle with Python
How to make a Python package (written for an intern)
Prepare python3 environment with Docker
[SAP CP] Web API created with python in CF environment
I want to use a virtual environment with jupyter notebook!