Skip to content

Instantly share code, notes, and snippets.

---
- name: Log into scaleway docker registry
command: docker login {{ scaleway_registry }} -u {{ scaleway_user }} -p {{ scaleway_token }}
no_log: true
- name: Pull docker images
command: docker-compose pull
args:
chdir: "{{ docker_compose_path }}"
---
- hosts: web_server
roles:
- role: deploy-docker
vars:
docker_compose_path: /etc/docker/
vars_files:
- vars/scaleway_credentials.yml
[staging:children]
web_server
[web_server]
163.172.214.134 ansible_user=root ansible_become=yes # ICI VALUER LA BONNE IP
version: "2.1"
executors:
node:
docker:
- image: circleci/node:14.16.0
ubuntu:
machine:
image: ubuntu-2004:202010-01
jobs:
build-docker-image:
# ----- build image -----
FROM node:14.15.0-alpine AS build-env
WORKDIR /app
COPY . /app
RUN yarn install
RUN yarn build
#!/bin/sh
set -e
cd "$(dirname "$0")"
VERSION="$(git describe --always | sed 's/^v//')"
PACKAGE="$(git config --get remote.origin.url | awk -F '@[^:/]+[:/]?' '{print $(NF)}' | sed s'/.git$//')"
DOCKER_TAG=${DOCKER_TAG:-$VERSION}
DOCKER_REGISTRY=${DOCKER_REGISTRY:=rg.fr-par.scw.cloud/thetribe} # ICI VALUER LE BON REGISTRY DOCKER
DOCKER_IMAGE=${DOCKER_IMAGE:=$DOCKER_REGISTRY/$PACKAGE:$DOCKER_TAG}
DOCKERFILE=${DOCKERFILE:-"Dockerfile"}
@TommyTheTribe
TommyTheTribe / docker-compose.yaml
Last active May 29, 2021 09:08
docker-compose.yaml
version: "3.5"
services:
backend:
image: rg.fr-par.scw.cloud/thetribe/backend:latest
restart: unless-stopped
container_name: backend
working_dir: /app
expose: - "8080"
ports: - "8080:8080"
environment: - NODE_ENV=staging