9 Commits
Author SHA1 Message Date
marc 915143a3fc forgot to uncomment pipfile from dockerignore
Docker / build (push) Canceled after 0s
Pylint / build (push) Canceled after 0s
2022-08-20 01:17:12 +02:00
marc c90df1c762 ignoring requirements.txt 2022-08-20 01:15:56 +02:00
marc d21e2fadf5 multistage 2022-08-20 01:14:37 +02:00
marc 368a74a1c7 docker build test 2022-08-20 00:46:09 +02:00
marc c1ba069b41 build and push 2022-08-20 00:02:24 +02:00
marc 0271e71974 update apt is slow 2022-08-20 00:01:33 +02:00
marc d209ad28c5 fix mistake 2022-08-19 23:58:22 +02:00
marc 9f5de228b5 trying new docker-push 2022-08-19 23:56:44 +02:00
marc 92871ae135 update 2022-08-19 19:55:11 +02:00
6 changed files with 866 additions and 655 deletions
+1 -2
View File
@@ -15,8 +15,7 @@ venv
.buildpacks
*.pem
*.crt
Pipfile
Pipfile.lock
.travis.yml
.gitignore
.dockerignore
requirements.txt
+41
View File
@@ -0,0 +1,41 @@
name: Docker
on:
push:
branches:
- "*"
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Run tests for any PRs.
pull_request:
env:
IMAGE_NAME: website
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
context: .
push: false
tags: marcpartensky/website:latest
+11 -3
View File
@@ -19,8 +19,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update apt
run: sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
- name: Install make
run: sudo apt install make -y
- name: Install Python3.7
@@ -36,13 +34,23 @@ jobs:
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
id: build
uses: docker/build-push-action@v2
with:
push: false
tags: marcpartensky/website:latest
- name: Compose up
run: docker-compose -f dev.yml up -d website postgres mysql
- name: Test
run: docker-compose run test
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
id: push
uses: docker/build-push-action@v2
with:
push: true
+15 -8
View File
@@ -1,4 +1,15 @@
FROM python:3.7.12
FROM python:3.7.12-alpine as builder
COPY . /app
WORKDIR /app
RUN apk update
RUN apk add curl npm
RUN pip install pipenv
RUN pipenv update
RUN npm install
FROM python:3.7.12-alpine
# ARG timestamp
# ARG commit
LABEL maintainer="marc.partensky@gmail.com"
@@ -8,15 +19,11 @@ LABEL link="https://marcpartensky.com"
# LABEL build.timestamp=timestamp
# LABEL build.commit=commit
COPY . /app
COPY --from=builder . /app
WORKDIR /app
RUN apt-get update
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash
RUN apt-get install -y nodejs
RUN npm install -g npm@latest
RUN npm install
RUN apk update
RUN apk add curl npm
# No .pyo and easier debugging
ENV PYTHONDONTWRITEBYTECODE 1
Generated
+762 -608
View File
File diff suppressed because it is too large Load Diff
+36 -34
View File
@@ -21,16 +21,6 @@ x-common:
REDIS_URL: redis:6379
services:
# nginx:
# image: jwilder/nginx-proxy
# restart: unless-stopped
# networks:
# - web
# ports:
# - "127.0.1.1:80:80"
# volumes:
# - /var/run/docker.sock:/tmp/docker.sock:ro
website:
image: marcpartensky/website
environment:
@@ -53,6 +43,12 @@ services:
- postgres
networks:
- web
healthcheck:
test: ["CMD", "curl", "-fs", "http://website:80/robots.txt"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
postgres:
image: postgres
@@ -109,32 +105,38 @@ services:
networks:
- web
website-test:
environment:
<<: *website
<<: *postgres
<<: *redis
VIRTUAL_HOST: website.dev
build:
context: .
dockerfile: ./Dockerfile
working_dir: /app
entrypoint: /app/entrypoint.sh
command: 80 0.0.0.0
volumes:
- ".:/app"
# website-test:
# environment:
# <<: *website
# <<: *postgres
# <<: *redis
# VIRTUAL_HOST: website.dev
# build:
# context: .
# dockerfile: ./Dockerfile
# working_dir: /app
# entrypoint: /app/entrypoint.sh
# command: 80 0.0.0.0
# volumes:
# - ".:/app"
# networks:
# - web
# - caddy
# healthcheck:
# test: ["CMD", "curl", "-fs", "http://website:80/robots.txt"]
# interval: 1m30s
# timeout: 10s
# retries: 3
# start_period: 40s
# labels:
# - "caddy=test.marcpartensky.com"
# - "caddy.reverse_proxy={{upstreams http 80}}"
test:
image: jwilder/dockerize
networks:
- web
- caddy
healthcheck:
test: ["CMD", "curl", "-fs", "http://website:80/robots.txt"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
labels:
- "caddy=test.marcpartensky.com"
- "caddy.reverse_proxy={{upstreams http 80}}"
command: -wait http://website:8080/healthcheck -timeout 120s -wait-retry-interval 5s
networks:
web: