Docker build

This commit is contained in:
Mylloon 2021-07-27 22:51:52 +02:00
parent ac5f108e00
commit 5cb605b6be
2 changed files with 28 additions and 5 deletions

View file

@ -1,7 +1,22 @@
latest:
image: python:3.9.5-slim
stages:
- build
- test
- deploy
variables:
# disable Docker TLS validation
DOCKER_TLS_CERTDIR: ""
# localhost address is shared by both the job container and the dind container (as they share the same Pod)
# So this configuration make the dind service as our Docker daemon when running Docker commands
DOCKER_HOST: "tcp://localhost:2375"
services:
- docker:stable-dind
docker-build:
image: docker:stable
stage: build
script:
- pip install -r requirements.txt
- cd src
- python main.py
- docker build
- docker tag registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot:${CI_COMMIT_SHORT_SHA}
- docker push registry.gitlab.com/ConfrerieDuKassoulait/TwitchBot:${CI_COMMIT_SHORT_SHA}

8
Dockerfile Normal file
View file

@ -0,0 +1,8 @@
FROM python:3.9.5-slim
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY src .
CMD [ "python", "-u", "./main.py" ]