Skip to content

Commit 0acde12

Browse files
committed
feat: non root
1 parent a45ea68 commit 0acde12

File tree

3 files changed

+45
-6
lines changed

3 files changed

+45
-6
lines changed

Diff for: .github/workflows/workflow.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test, build and push to github packages
2+
on:
3+
pull_request:
4+
branches:
5+
- 'master'
6+
push:
7+
branches:
8+
- '*'
9+
tags:
10+
- '*.*.*'
11+
12+
jobs:
13+
build-images:
14+
if: ${{ github.event_name == 'push' }}
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set ENV for branch master/main
19+
if: ${{ github.ref == 'refs/heads/master' }}
20+
run: echo "RELEASE_VERSION=latest" >> $GITHUB_ENV
21+
- name: Set ENV for tags
22+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
23+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
24+
- name: Set ENV for specific branch
25+
if: ${{ startsWith(github.ref, 'refs/heads/') && !endsWith(github.ref, '/master') }}
26+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}-${GITHUB_SHA}" >> $GITHUB_ENV
27+
- name: Login to GHCR
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.repository_owner }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
- name: Build Image Odoo Healthz
34+
uses: docker/build-push-action@v2
35+
with:
36+
context: ./9.0
37+
platforms: linux/amd64
38+
push: true
39+
tags: ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }}

Diff for: 9.0/Dockerfile

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
FROM docker.io/nginx:1.25.1-bookworm
2-
MAINTAINER Camptocamp
1+
FROM nginxinc/nginx-unprivileged:bookworm
32

4-
ADD https://github.com/kelseyhightower/confd/releases/download/v0.11.0/confd-0.11.0-linux-amd64 /usr/local/bin/confd
3+
ADD --chown=nginx:nginx https://github.com/kelseyhightower/confd/releases/download/v0.16.0/confd-0.16.0-linux-amd64 /usr/local/bin/confd
54
RUN chmod +x /usr/local/bin/confd
6-
5+
USER root
76
RUN mkdir -p /etc/confd/{conf.d,templates}
7+
RUN chown nginx:nginx /etc/confd/{conf.d,templates}
8+
USER nginx
89
COPY conf.d /etc/confd/conf.d
910
COPY templates /etc/confd/templates
1011
COPY docker-entrypoint.sh /docker-entrypoint.sh

Diff for: 9.0/templates/nginx.conf.tmpl

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
user nginx;
21

32
worker_rlimit_nofile 1024;
43
worker_processes 1;
54

6-
pid /var/run/nginx.pid;
5+
pid /tmp/nginx.pid;
76
error_log /var/log/nginx/error.log;
87

98
events {

0 commit comments

Comments
 (0)