diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9e1d9de --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +pelican +__pycache__ +*.pyc +*.o +output/ +node_modules/ +.venv/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..cca01be --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,18 @@ +stages: + - build + - test + - deploy + +image: docker:19.03.12 + +before_script: + - docker info + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + +build: + stage: build + tags: + - integration + script: + - docker build -t $CI_REGISTRY_IMAGE:${TAG:-latest} . + - docker push $CI_REGISTRY_IMAGE:${TAG:-latest} diff --git a/Dockerfile b/Dockerfile index 1446540..c967a1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,4 +16,6 @@ FROM openresty/openresty:buster-fat COPY --from=build /app/output /var/www/pelican/output/ +EXPOSE 80 + COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/README.md b/README.md index 2b563b1..c21bcd1 100644 --- a/README.md +++ b/README.md @@ -10,5 +10,10 @@ source env/bin/activate pip install -r requirements.txt make devserver ``` +## With Docker + +docker build -t ge-blog . + +docker run -p 8000:80 ge-blog