-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (38 loc) · 1.38 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Delete all images + containers
# docker rm $(docker ps -a -q); docker rmi $(docker images -q)
# Build image
# docker image build -t parcelspot_rpi .
# Run
# docker run -p 5000:5000 --rm parcelspot_rpi
# Run in background
# docker run -d -p 5000:5000 --rm parcelspot_rpi
# docker build -t jeroenvo/parcelspot-rpi .
# docker run -d -p 5000:5000 --name parcelspot-rpi --rm jeroenvo/parcelspot-rpi
# docker run -d -p 5000:5000 --name parcelspot-rpi --rm jeroenvo/parcelspot-rpi --device=/dev/video0:/dev/video0
# docker run --device=/dev/video0:/dev/video0 -d -p 5000:5000 --name parcelspot-rpi --rm jeroenvo/parcelspot-rpi:71400f4
# sudo modprobe bcm2835-v4l2
# Docker hub
# docker push jeroenvo/parcelspot-rpi:test1
# docker pull jeroenvo/parcelspot-rpi:test1
# docker run -d -p 5000:5000 --name parcelspot-rpi --rm jeroenvo/parcelspot-rpi:71400f4
# Commands in container
# docker exec -it CONTAINER_ID /bin/bash
FROM mohaseeb/raspberrypi3-python-opencv:latest
# Create app directory
WORKDIR /app
# Update ubuntu
RUN apt-get update
RUN apt-get upgrade -y
# Install ZBar
RUN apt-get install zbar-tools -y
RUN apt-get install libzbar-dev -y
# Copy project in container
COPY . /app
# Update pip
RUN pip install --upgrade pip
# Install libs
RUN pip install --no-cache-dir -r requirements.txt
# Run application
CMD export FLASK_APP=__init__.py; flask run --host=0.0.0.0 --port=5000
# Expose port
EXPOSE 5000