Browse Source

build: fix Docker image build (#180)

tags/v0.10.0
Jérôme Deuchnord 3 years ago
committed by GitHub
parent
commit
50f9e9eeba
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 11 deletions
  1. +26
    -0
      .github/workflows/dockerfile.yml
  2. +15
    -8
      Dockerfile
  3. +3
    -3
      setup.cfg

+ 26
- 0
.github/workflows/dockerfile.yml View File

@@ -0,0 +1,26 @@
name: Docker image

on:
push:
branches: [master, features]
pull_request:
branches: [master, features]

jobs:
build-image:
runs-on: ubuntu-latest

name: Test building Docker image
steps:
- uses: actions/checkout@v1

- name: Set up Docker
uses: docker-practice/actions-setup-docker@v1

- name: Create image
run: |
docker build -t kosmorro .

- name: Execute image
run: |
docker run kosmorro kosmorro

+ 15
- 8
Dockerfile View File

@@ -6,22 +6,29 @@ WORKDIR /home/kosmorro

ENV PATH="/home/kosmorro:${PATH}"

# Prepare environment
RUN python -m pip install --upgrade pip

RUN pip install pipenv

COPY Pipfile.lock .

RUN pipenv sync && pipenv run pip freeze > requirements.txt

RUN pip uninstall pipenv -y

# Add files
RUN pip install -r requirements.txt

COPY kosmorrolib/ kosmorrolib/

COPY _kosmorro/ _kosmorro/
COPY kosmorro .

# Compile the translations
RUN pip install Babel
COPY setup.py setup.py
COPY setup.cfg setup.cfg
COPY README.md README.md
RUN python setup.py compile_catalog

# Clean the image
RUN rm setup.py setup.cfg README.md && \
rm _kosmorro/locales/messages.pot _kosmorro/locales/*/LC_MESSAGES/messages.po && \
pip uninstall --yes Babel pipenv

USER kosmorro

CMD ["bash"]

+ 3
- 3
setup.cfg View File

@@ -2,11 +2,11 @@
charset = utf-8
keywords = _ ngettext
width = 120
output_file = kosmorrolib/locales/messages.pot
output_file = _kosmorro/locales/messages.pot
omit_header = true
copyright_holder = Jérôme Deuchnord
input_paths=kosmorro,kosmorrolib
input_paths=kosmorro,_kosmorro

[compile_catalog]
domain = messages
directory = kosmorrolib/locales
directory = _kosmorro/locales

Loading…
Cancel
Save