Skip to content

Commit

Permalink
feat: container build
Browse files Browse the repository at this point in the history
  • Loading branch information
lpmatos committed Jul 27, 2020
1 parent 282bd92 commit dc8129c
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 5 deletions.
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ARG PYTHON_VERSION=3.8-alpine3.11

FROM python:${PYTHON_VERSION} as base

FROM base as install-env

COPY [ "requirements.txt", "."]

RUN pip install --upgrade pip && \
pip install --upgrade setuptools && \
pip install --user --no-warn-script-location -r ./requirements.txt

FROM base

RUN set -ex && apk update

COPY --from=install-env [ "/root/.local", "/usr/local" ]

WORKDIR /usr/src/code

COPY [ "./gitlab-clone", "." ]

RUN find ./ -iname "*.py" -type f -exec chmod a+x {} \; -exec echo {} \;;
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']}
module.exports = {extends: ['@commitlint/config-conventional']}
48 changes: 48 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: "3.8"

# ==============================================================================
# ANCHORS
# ==============================================================================

x-logging: &default-logging
driver: "json-file"
options:
max-size: "500k"
max-file: "20"

x-entrypoint: &default-entrypoint
entrypoint: >
/bin/sh -c "
set -e
chmod a+x /usr/local/bin/wait && \
/usr/local/bin/wait && echo Hello
/bin/bash || exit 0
"
x-volumes: &default-volumes
volumes:
- ./scripts/wait:/usr/local/bin/wait

# ==============================================================================
# SERVICES
# ==============================================================================

services:

python-rabbitmq:
container_name: ${CONTAINER_NAME}
env_file: [ "./.env" ]
build:
context: ./${PATH_DOCKERFILE}
dockerfile: Dockerfile
<<: *default-entrypoint
stdin_open: true
tty: true
healthcheck:
test: nc -z rabbitmq 5672 || exit 1
interval: 10s
timeout: 2s
retries: 10
restart: on-failure
logging: *default-logging
depends_on: [ "rabbitmq" ]
<<: *default-volumes
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-gitlab
python-gitlab==2.4.0
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
packages=['gitlab-clone'],
zip_safe=False,
install_requires=[
'click',
'requests',
'colorama'
'python-gitlab'
],
entry_points = {
'console_scripts': ['gitlab-clone=gitlab-clone.cli:main'],
Expand Down

0 comments on commit dc8129c

Please sign in to comment.