[英]how to create an ubuntu environment when using Docker on MAC computer with django
I am super new to Docker and i am trying to grasp a concept.我对 Docker 非常陌生,我正在尝试掌握一个概念。
Goal: I am trying to create this tech stack目标:我正在尝试创建这个技术堆栈
create a Ubuntu OS
install python
install django/DRF
install postgresql
install reactJS
So far I have only been able to install python, django...到目前为止,我只能安装 python、django...
FROM python:3.7
ENV PYTHONUNBUFFERED 1
WORKDIR /code
COPY requirements.txt /code
RUN pip install -r requirements.txt
COPY . /django-docker/
version: '3.7'
services:
web:
build: .
command: python /code/manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- 8000:8000
My question is mainly on how do I install or add Ubuntu on the tech stack mentioned above or is it really necessary to have Ubuntu if i intend to deploy my tech stack to AWS in the future so other developers can work on the same project quickly when they setup their machines?我的问题主要是关于如何在上面提到的技术堆栈上安装或添加Ubuntu或者如果我打算将来将我的技术堆栈部署到 AWS 是否真的需要 Ubuntu 以便其他开发人员可以在同一项目上快速工作他们设置他们的机器?
If you see your Dockerfile, you have specified base image as python:3.7 .如果您看到 Dockerfile,则您已将基本映像指定为python:3.7 。
If you visit the dockerfile of the base image python:3.7 here , you can see that basically you are installing a debian os and then python.To be more clear,If the image name is python:3.7, you get a docker image of debain with python 3.7 installed. If you visit the dockerfile of the base image python:3.7 here , you can see that basically you are installing a debian os and then python.To be more clear,If the image name is python:3.7, you get a docker image of debain安装了 python 3.7。
Now if you want to install ubuntu, you can set the base image as ubuntu:[tag] and then install each dependencies (python 3.7, django,postgresql,reactsjs). Now if you want to install ubuntu, you can set the base image as ubuntu:[tag] and then install each dependencies (python 3.7, django,postgresql,reactsjs).
You can view this article which will help you to decide base docker image for your use case.您可以查看这篇文章,它将帮助您为您的用例确定基本 docker 映像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.