Skip to content
Snippets Groups Projects
Commit b44688f2 authored by Vincent Mazenod's avatar Vincent Mazenod
Browse files

fixup! fix ci

parent 05be26aa
No related branches found
No related tags found
No related merge requests found
Pipeline #9291 skipped
# FROM nikolaik/python-nodejs:python3.7-nodejs16-bullseye AS compile-image
FROM nikolaik/python-nodejs:python3.7-nodejs16-bullseye AS source-image
ARG DEBIAN_FRONTEND=noninteractive
RUN { \
echo krb5-config krb5-config/default_realm string 'LOCAL.ISIMA.FR'; \
echo tzdata tzdata/Areas string 'Etc'; \
echo tzdata tzdata/Zones/Etc string 'UTC'; \
} | debconf-set-selections \
&& \
apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc \
apt-utils \
krb5-user \
krb5-config \
locales \
rsync \
&& \
locale-gen fr_FR \
locale-gen fr_FR.UTF-8 \
update-locale LANG=fr_FR.UTF-8 \
. /etc/default/locale
COPY requirements.txt .
RUN pip install --user -r requirements.txt
COPY content/package.json ./content/package.json
RUN cd content && yarn install
# FROM nikolaik/python-nodejs:python3.7-nodejs16-bullseye AS build-image
# COPY --from=compile-image /root/.local /root/.local
# COPY --from=compile-image /usr/bin /usr/bin
# COPY --from=compile-image /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
# LABEL stage=builder
ENV SRV_DIR=//srv
ENV WORKING_DIR=//srv/pelican
ENV PORT=8000
ENV PATH=/root/.local/bin:$PATH
ADD . $SRV_DIR
WORKDIR $WORKING_DIR
RUN mkdir output content cache
VOLUME ["$WORKING_DIR/"]
# make python server in foreground
RUN sed -i 's/\$port &/\$port/g' $SRV_DIR/develop_server.sh
RUN chmod +x $SRV_DIR/develop_server.sh
EXPOSE $PORT
ENTRYPOINT $SRV_DIR/develop_server.sh start $PORT
.env 0 → 100644
REGISTRY_URL=docker.isima.fr
NAMESPACE=docker.isima.fr/vimazeno
APP_NAME=pelican_perso
\ No newline at end of file
Makefile 0 → 100644
BOLD := \033[1m
RESET := \033[0m
RED := \033[31m
GREEN := \033[32m
YELLOW := \033[33m
BLUE := \033[34m
MAGENTA := \033[35m
SHELL := /bin/bash
IMAGES := $(shell docker-compose config --services)
TAG := $(shell git rev-parse --short HEAD)
VOLUMES := content/node_modules output
# Executables (local)
DOCKER_COMP := docker-compose
.DEFAULT_GOAL := help
# Docker containers
PELICAN_CONT := $(DOCKER_COMP) exec pelican
include .env
build: ## Build required docker compose images
@$(DOCKER_COMP) build
@docker image prune -f --filter label=stage=source-image
@docker image prune -f --filter label=stage=build-image
.PHONY: build
push: ## Push build docker compose images
@docker login ${REGISTRY_URL}
@docker push ${NAMESPACE}/${APP_NAME}:latest
@docker image tag ${NAMESPACE}/${APP_NAME}:latest ${NAMESPACE}/${APP_NAME}:${TAG}
@docker push ${NAMESPACE}/${APP_NAME}:${TAG} ;
.PHONY: push
up: ## Make required containers up
@$(DOCKER_COMP) up --remove-orphans
.PHONY: up
down: ## Make required containers down
@$(DOCKER_COMP) down
.PHONY: down
logs: ## Show live containers logs. Pass the parameter "c=" to see one specific container's logs, example: make logs c='frontend'
@$(eval c ?=)
@if [ -z "$(c)" ]; then \
$(DOCKER_COMP) logs --follow; \
else \
$(DOCKER_COMP) logs --timestamps --follow $(c); \
fi
.PHONY: logs
errors: ## Show live container errors.
@$(DOCKER_COMP) logs | grep error
.PHONY: errors
pelican: ## Open bash on php container
@$(PELICAN_CONT) bash
.PHONY: pelican
clean: ## Remove node and php folders and files
@for volume in ${VOLUMES} ; do \
sudo rm -rf $${volume} ; \
done
.PHONY: clean
help:
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help
\ No newline at end of file
version: '3.5'
services:
pelican:
image: ${NAMESPACE}/${APP_NAME}:latest
build:
context: .
dockerfile: .docker/build/pelican/Dockerfile
container_name: pelican
environment:
TZ: ${TIMEZONE:-Europe/Paris}
volumes:
- .:/srv/pelican
ports:
- "8000:8000"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment