Spaces:
Build error
Build error
Pietro Lesci
commited on
Commit
•
49085cc
1
Parent(s):
3fc268f
dockerize app
Browse files- Dockerfile +20 -0
- Makefile +21 -0
Dockerfile
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# FROM continuumio/miniconda3:4.10.3-alpine
|
2 |
+
FROM python:3.7
|
3 |
+
|
4 |
+
# RUN apt-get -y update && apt-get -y install build-essential
|
5 |
+
# RUN conda update -n base -c defaults conda
|
6 |
+
# RUN conda install --force-reinstall -y -q --name base pip
|
7 |
+
|
8 |
+
# chown changes owner from root owner (1000) to the first user inside the env (100)
|
9 |
+
# COPY --chown=1000:100 requirements.txt /opt/requirements.txt
|
10 |
+
# COPY . .
|
11 |
+
# # RUN conda install --force-reinstall -y -q --name base -c conda-forge --file requirements.txt
|
12 |
+
# # RUN conda install --force-reinstall -y -q --name base pip
|
13 |
+
# RUN pip install -r requirements.txt
|
14 |
+
# CMD streamlit run ./app.py
|
15 |
+
|
16 |
+
COPY . /var/app/
|
17 |
+
WORKDIR /var/app
|
18 |
+
RUN pip install --upgrade pip
|
19 |
+
RUN pip install -r requirements.txt
|
20 |
+
CMD streamlit run ./app.py
|
Makefile
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Docker image build info
|
2 |
+
PROJECT:=wordify
|
3 |
+
BUILD_TAG?=v2.0
|
4 |
+
|
5 |
+
########################################################
|
6 |
+
## Local development
|
7 |
+
########################################################
|
8 |
+
dev: ARGS?=/bin/bash
|
9 |
+
dev: DARGS?=-v "${CURDIR}":/var/dev
|
10 |
+
dev: ## run a foreground container
|
11 |
+
docker run -it --rm -p 8501:8501 $(DARGS) $(PROJECT):${BUILD_TAG} $(ARGS)
|
12 |
+
|
13 |
+
build: DARGS?=
|
14 |
+
build: ## build the latest image for a project
|
15 |
+
docker build $(DARGS) --build-arg BUILD_TAG=${BUILD_TAG} --rm --force-rm -t $(PROJECT):${BUILD_TAG} .
|
16 |
+
|
17 |
+
########################################################
|
18 |
+
## Deployment
|
19 |
+
########################################################
|
20 |
+
run:
|
21 |
+
docker run -d --name $(PROJECT)-${BUILD_TAG}-container -it --rm -p 8501:8501 $(PROJECT):${BUILD_TAG}
|