Skip to content

Commit a03af31

Browse files
authored
Merge pull request #2043 from c2corg/revert-build
chore: revert to previous build behavior
2 parents f7db8de + 25fc946 commit a03af31

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+637
-626
lines changed

.dockerignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
.build/
22
.git/
33
.gitignore
4-
.gitattributes
54
.travis.yml
6-
.github
7-

.github/workflows/ci.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
image: postgis/postgis
3232
env:
3333
POSTGRES_USER: postgres
34-
POSTGRES_PASSWORD: test
34+
POSTGRES_PASSWORD: postgres
3535
options: >-
3636
--health-cmd pg_isready
3737
--health-interval 10s
@@ -57,19 +57,20 @@ jobs:
5757
- name: Install python dependencies
5858
run: |
5959
python -m pip install --upgrade pip setuptools wheel
60-
python -m pip install .[dev]
60+
python -m pip install -r dev-requirements.txt -r requirements.txt
6161
- name: Lint
6262
run: flake8 c2corg_api es_migration
6363
- name: Configure postgres
6464
run: |
65-
scripts/database/create_test_schema.sh
65+
echo "create user \"www-data\" with password 'www-data'" | psql
66+
USER=github scripts/create_user_db_test.sh
6667
env:
67-
PGPASSWORD: test
68+
PGPASSWORD: postgres
6869
PGUSER: postgres
6970
PGHOST: localhost
7071
PGPORT: 5432
7172
- name: Create config from templates
72-
run: make CONFIG=config/env.test load-env
73+
run: make -f config/github-actions template
7374
- name: Install java 8 for (old) elasticsearch
7475
uses: actions/setup-java@v4
7576
with:
@@ -112,13 +113,13 @@ jobs:
112113
images: ghcr.io/c2corg/v6_api
113114
- name: Checkout repository
114115
uses: actions/checkout@v4.1.1
115-
- run: git archive --format=tar --output docker/project.tar "$GITHUB_SHA"
116+
- run: git archive --format=tar --output project.tar "$GITHUB_SHA"
116117
- name: Set up Docker Buildx
117118
uses: docker/setup-buildx-action@v3
118119
- name: Publish the docker image
119120
uses: docker/build-push-action@v6
120121
with:
121-
context: ./docker
122+
context: .
122123
provenance: false # true creates issues with the old docker compose used in prod
123124
push: ${{ github.event_name != 'pull_request' }}
124125
tags: ${{ steps.docker_meta.outputs.tags }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@
2020
config/docker
2121
.coverage
2222
coverage.xml
23-
/config/env.local

Dockerfile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
FROM docker.io/debian:bullseye-slim
2+
3+
ENV DEBIAN_FRONTEND noninteractive
4+
5+
ENV LC_ALL en_US.UTF-8
6+
7+
RUN set -x \
8+
&& apt-get update \
9+
&& apt-get -y upgrade \
10+
&& apt-get -y --no-install-recommends install locales \
11+
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
12+
&& locale-gen en_US.UTF-8 \
13+
&& dpkg-reconfigure locales \
14+
&& /usr/sbin/update-locale LANG=en_US.UTF-8
15+
16+
COPY project.tar /tmp
17+
18+
WORKDIR /var/www/
19+
20+
RUN tar -xvf /tmp/project.tar && chown -R root:root /var/www
21+
22+
RUN set -x \
23+
&& apt-get -y --no-install-recommends install \
24+
python3 \
25+
python3-chardet \
26+
python3-colorama \
27+
python3-html5lib \
28+
python3-pkg-resources \
29+
python3-requests \
30+
python3-six \
31+
python3-urllib3 \
32+
libgeos-c1v5 \
33+
libpq5 \
34+
libffi7 \
35+
make \
36+
python3-dev \
37+
python3-pip \
38+
libgeos-dev \
39+
libffi-dev \
40+
libpq-dev \
41+
virtualenv \
42+
gcc \
43+
git \
44+
curl \
45+
jq \
46+
postgresql-client
47+
48+
RUN set -x \
49+
&& make -f config/dev install \
50+
&& py3compile -f .build/venv/ \
51+
&& rm -fr .cache \
52+
&& apt-get -y purge \
53+
&& apt-get -y --purge autoremove \
54+
&& apt-get clean \
55+
&& rm -rf /var/lib/apt/lists/*
56+
57+
ARG VERSION
58+
ENV version=$VERSION \
59+
PATH=/var/www/.build/venv/bin/:$PATH
60+
61+
COPY /docker-entrypoint.sh /
62+
COPY /docker-entrypoint.d/* /docker-entrypoint.d/
63+
ENTRYPOINT ["/docker-entrypoint.sh"]
64+
65+
EXPOSE 8080
66+
CMD ["gunicorn", "--paste", "production.ini", "-u", "www-data", "-g", "www-data", "-b", ":8080"]

HOWTO-DEV.md

Lines changed: 0 additions & 112 deletions
This file was deleted.

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
include *.txt *.ini *.cfg *.md
22
recursive-include c2corg_api *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml
3-
graft c2corg_api/emails/

0 commit comments

Comments
 (0)