Add gitlab build script, fix dockerfile and dockerignore

This commit is contained in:
Piv
2020-08-24 21:33:20 +09:30
parent db111e6df7
commit e2cef4530b
3 changed files with 13 additions and 7 deletions

View File

@@ -1,8 +1,6 @@
**/*.jpg **/*.jpg
**/*.png **/*.png
tests tests
MotorControl
Messaging
Web Web
**/*.mdj **/*.mdj
**/*.pdf **/*.pdf

7
pycar/.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,7 @@
image: docker
build:
stage: build
script:
- cd pycar
- docker build -f pycar/Dockerfile --build-arg PYPI_USERNAME=${PYPI_USERNAME} --build-arg PYPI_PASSWORD=${PYPI_PASSWORD} pycar

View File

@@ -1,10 +1,7 @@
FROM vato.ddns.net:8083/python:3 FROM vato.ddns.net:8083/python:3
ARG PYPI_USERNAME
ARG PYPI_PASSWORD
RUN apt-get update RUN apt-get update
# OpenCV has a LOT of dependencies. # OpenCV dependencies.
RUN apt-get install -y \ RUN apt-get install -y \
libglib2.0-0 \ libglib2.0-0 \
libsm6 \ libsm6 \
@@ -19,6 +16,10 @@ RUN apt-get install -y \
libpq-dev \ libpq-dev \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
ARG PYPI_USERNAME
ARG PYPI_PASSWORD
COPY requirements.txt / COPY requirements.txt /
RUN pip install --index-url https://${PYPI_USERNAME}:${PYPI_PASSWORD}@vato.ddns.net/nexus/repository/pypi-grouped/simple -r requirements.txt RUN pip install --index-url https://${PYPI_USERNAME}:${PYPI_PASSWORD}@vato.ddns.net/nexus/repository/pypi-grouped/simple -r requirements.txt
@@ -33,4 +34,4 @@ ENV CAR_LIDAR=LIDAR_MOCK
# EXPOSE 1883 # EXPOSE 1883
ENV PYTHONPATH=/app ENV PYTHONPATH=/app
CMD ["python", "-m", "car"] ENTRYPOINT ["python", "-m", "car"]