Skip to content

Commit 3821d1d

Browse files
author
Robert Chu
committed
Updates Dockerfiles to use local package install instead of pypi.
1 parent 845e4dd commit 3821d1d

8 files changed

Lines changed: 34 additions & 42 deletions

File tree

.github/workflows/publish.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ jobs:
7171
password: ${{ secrets.PYPI_API_TOKEN }}
7272

7373
publish-docker:
74-
needs: publish-pypi
7574
if: startsWith(github.ref, 'refs/tags')
7675
name: Publish script-runner to dockerhub
7776
runs-on: ubuntu-latest
@@ -119,7 +118,7 @@ jobs:
119118
- name: Push to Docker Hub
120119
uses: docker/build-push-action@v2
121120
with:
122-
context: ./docker
121+
context: ./
123122
file: ./docker/Dockerfile
124123
builder: ${{ steps.buildx.outputs.name }}
125124
push: ${{ github.event_name != 'pull_request' }}
@@ -135,7 +134,6 @@ jobs:
135134
PYTHON_IMAGE_TAG=${{ steps.prep.outputs.pyversion }}
136135
137136
publish-docker-example:
138-
needs: publish-pypi
139137
if: startsWith(github.ref, 'refs/tags')
140138
name: Publish script-runner-example to dockerhub
141139
runs-on: ubuntu-latest
@@ -181,7 +179,7 @@ jobs:
181179
- name: Push to Docker Hub
182180
uses: docker/build-push-action@v2
183181
with:
184-
context: ./docker
182+
context: ./
185183
file: ./docker/Dockerfile.example
186184
builder: ${{ steps.buildx.outputs.name }}
187185
push: ${{ github.event_name != 'pull_request' }}
File renamed without changes.

docker-compose.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ services:
33
server:
44
image: labflow/script-runner-example:latest
55
build:
6-
dockerfile: ./Dockerfile.example
7-
context: ./docker
6+
dockerfile: ./docker/Dockerfile.example
7+
context: ./
88
args:
99
SERVER_VERSION: local+devcontainer
1010
command: "python3 -m flask run --host=0.0.0.0 --port=5000"
@@ -23,8 +23,8 @@ services:
2323
worker:
2424
image: labflow/script-runner-example:latest
2525
build:
26-
dockerfile: ./Dockerfile.example
27-
context: ./docker
26+
dockerfile: ./docker/Dockerfile.example
27+
context: ./
2828
args:
2929
SERVER_VERSION: local+devcontainer
3030
command: "python3 -m celery -A script_runner.analysis worker"

docker/Dockerfile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,12 @@ ARG PYTHON_IMAGE_TAG=alpine
22

33
FROM python:${PYTHON_IMAGE_TAG}
44

5-
ARG SCRIPT_RUNNER_VERSION=local+container
6-
75
WORKDIR /app
86

9-
RUN pip install \
10-
script-runner-api==${SCRIPT_RUNNER_VERSION}
11-
12-
COPY ./entrypoint.sh /entrypoint.sh
13-
RUN dos2unix /entrypoint.sh
14-
RUN chmod +x /entrypoint.sh
7+
COPY . /script-runner
8+
RUN pip install /script-runner
9+
RUN rm -rf /script-runner
1510

1611
ENV FLASK_APP=script_runner.main:app
17-
ENV SERVER_VERSION=$SERVER_VERSION
1812

19-
ENTRYPOINT [ "/entrypoint.sh" ]
13+
CMD "python3 -m gunicorn.app.wsgiapp --timeout 240 --bind 0.0.0.0:${PORT} --access-logfile - --error-logfile - --workers 4 ${FLASK_APP}"

docker/Dockerfile.example

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM rocker/verse:3.6.3
22

33
ARG SERVER_VERSION=local+container
4-
ARG SCRIPT_RUNNER_VERSION=local+container
54

65
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76
# Install extra *nix utils
@@ -63,13 +62,13 @@ RUN git clone git://github.com/lab-grid/swabseq-analysis /app
6362
# Python Env
6463
WORKDIR /app
6564

66-
RUN pip3 install \
67-
pandas \
68-
script-runner-api==${SCRIPT_RUNNER_VERSION}
65+
RUN pip3 install pandas
6966

70-
COPY ./entrypoint.sh /entrypoint.sh
71-
RUN dos2unix /entrypoint.sh
72-
RUN chmod +x /entrypoint.sh
67+
COPY . /script-runner
68+
RUN pip3 install /script-runner
69+
RUN rm -rf /script-runner
70+
71+
COPY ./config.json /app/config.json
7372

7473
RUN mkdir /base-rundir
7574
RUN wget -qO- https://swabseq-analysis-examples.s3-us-west-1.amazonaws.com/bcls/H3FY3K.tar.gz \
@@ -79,4 +78,4 @@ ENV PYTHONPATH="${RBASE}:${PYTHONPATH}"
7978
ENV FLASK_APP=script_runner.main:app
8079
ENV SERVER_VERSION=$SERVER_VERSION
8180

82-
ENTRYPOINT [ "/entrypoint.sh" ]
81+
CMD "python3 -m gunicorn.app.wsgiapp --timeout 240 --bind 0.0.0.0:${PORT} --access-logfile - --error-logfile - --workers 4 ${FLASK_APP}"

docker/entrypoint.sh

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

example.env

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
SERVER_NAME=localhost:5000
2+
3+
REDIS_PASSWORD=my-redis-password
4+
5+
AUTH_PROVIDER=none
6+
AUTH0_DOMAIN=
7+
AUTH0_CLIENT_ID=
8+
9+
AUTH0_API_AUTHORITY=
10+
AUTH0_API_AUDIENCE=
11+
12+
AUTH0_AUTHORIZATION_URL=
13+
AUTH0_TOKEN_URL=
14+

terraform/aws/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ terraform {
1414
# IAM -------------------------------------------------------------------------
1515

1616
resource "aws_iam_role" "labflow_role" {
17-
name = "${input.stack_name}-role"
17+
name = "${var.stack_name}-role"
1818

1919
# May be necessary: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role
2020
# force_detach_policies = true
@@ -47,7 +47,7 @@ EOF
4747
module "vpc" {
4848
source = "terraform-aws-modules/vpc/aws"
4949

50-
name = "${input.stack_name}-vpc"
50+
name = "${var.stack_name}-vpc"
5151

5252
enable_nat_gateway = true
5353
enable_dns_hostnames = true
@@ -61,7 +61,7 @@ module "vpc" {
6161
module "ecs" {
6262
source = "terraform-aws-modules/ecs/aws"
6363

64-
name = "${input.stack_name}-ecs"
64+
name = "${var.stack_name}-ecs"
6565

6666
container_insights = true
6767

0 commit comments

Comments
 (0)