Skip to content

Commit f5a1525

Browse files
authored
Merge pull request #61 from datacite/no-travis
Fix Dockerfile and add pull-request action
2 parents 19bb2f4 + 146c6e6 commit f5a1525

File tree

6 files changed

+418
-271
lines changed

6 files changed

+418
-271
lines changed

.github/workflows/pull_reqest.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CI Test
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Build the stack
13+
run: docker compose -f "docker-compose.yml" up -d
14+
- name: Run Tests
15+
run: docker compose -f "docker-compose.yml" run web ./bin/ci.sh
16+
- name: Stop containers
17+
if: always()
18+
run: docker compose -f "docker-compose.yml" down

Dockerfile

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1+
FROM phusion/passenger-customizable:2.0.0
2+
LABEL maintiainer="jrhoads@datacite.org"
13

2-
FROM phusion/passenger-full:1.0.6
4+
# Set correct environment variables.
5+
ENV HOME /home/app
6+
ENV LC_ALL en_US.UTF-8
7+
ENV LANG en_US.UTF-8
38

49
# Use baseimage-docker's init process.
510
CMD ["/sbin/my_init"]
611

7-
# Update installed APT packages
8-
RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold" && \
9-
apt-get install -y ntp pandoc
10-
11-
# Fetch PIP install script and run
12-
ADD "https://bootstrap.pypa.io/get-pip.py" /tmp/get-pip.py
13-
RUN python3 /tmp/get-pip.py
14-
15-
# Fetch pipenv install script and run
16-
ADD "https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py" /tmp/get-pipenv.py
17-
RUN python3 /tmp/get-pipenv.py
12+
# Allow app user to read /etc/container_environment
13+
RUN usermod -a -G docker_env app
1814

19-
# Cleanup
15+
RUN /pd_build/python.sh
16+
# Update installed APT packages
17+
RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold"
18+
RUN apt-get install -y ntp pandoc pipenv
2019
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2120

21+
2222
# Enable Passenger and Nginx and remove the default site
2323
# Preserve env variables for nginx
2424
RUN rm -f /etc/service/nginx/down && \
@@ -31,36 +31,36 @@ COPY vendor/docker/env.conf /etc/nginx/main.d/env.conf
3131
# Use Amazon NTP servers
3232
COPY vendor/docker/ntp.conf /etc/ntp.conf
3333

34+
# Run additional scripts during container startup (i.e. not at build time)
35+
RUN mkdir -p /etc/my_init.d
36+
37+
# enable SSH
38+
RUN rm -f /etc/service/sshd/down && \
39+
/etc/my_init.d/00_regen_ssh_host_keys.sh
40+
41+
# install custom ssh key during startup
42+
COPY vendor/docker/10_ssh.sh /etc/my_init.d/10_ssh.sh
43+
44+
# restart server on file changes in development
45+
COPY vendor/docker/20_always_restart.sh /etc/my_init.d/20_always_restart.sh
46+
3447
## Viringo setup
3548

3649
# Copy webapp folder
3750
COPY . /home/app/webapp/
3851

39-
# Copy tests over to app folder
40-
COPY tests /home/app/tests
41-
4252
# Configure permissions
4353
RUN chown -R app:app /home/app/webapp && \
4454
chmod -R 755 /home/app/webapp
4555

4656
# Set working directory
4757
WORKDIR /home/app/webapp
4858

59+
# Update Pip and Pipenv
60+
RUN pip install -U pip pipenv
61+
4962
# Install any needed packages specified in pipenv pipfile
5063
RUN pipenv install --system --deploy --ignore-pipfile
5164

52-
# Run additional scripts during container startup (i.e. not at build time)
53-
RUN mkdir -p /etc/my_init.d
54-
55-
# enable SSH
56-
RUN rm -f /etc/service/sshd/down && \
57-
/etc/my_init.d/00_regen_ssh_host_keys.sh
58-
59-
# install custom ssh key during startup
60-
COPY vendor/docker/10_ssh.sh /etc/my_init.d/10_ssh.sh
61-
62-
# restart server on file changes in development
63-
COPY vendor/docker/20_always_restart.sh /etc/my_init.d/20_always_restart.sh
64-
6565
# Expose web
66-
EXPOSE 80
66+
EXPOSE 80

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ sentry-sdk = {extras = ["flask"],version = "*"}
2323
python-dotenv = "*"
2424

2525
[requires]
26-
python_version = "3.6"
26+
python_version = "3.8"

0 commit comments

Comments
 (0)