-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
48 lines (39 loc) · 1.42 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Core image for pods
# Image: tapis/pods-api
# Create base image
FROM python:3.10
RUN useradd tapis -u 4872
WORKDIR /home/tapis/
# set the name of the api, for use by some of the common modules.
ENV TAPIS_API=pods
ENV PYTHONPATH=.:*:pods:pods/*
## PACKAGE INITIALIZATION
COPY requirements.txt /home/tapis/
RUN apt-get update && apt-get install -y
RUN apt-get install libffi-dev vim curl -y
RUN pip3 install --upgrade pip
RUN pip3 install -r /home/tapis/requirements.txt
# rabbitmqadmin download for rabbit init
RUN wget https://raw.githubusercontent.com/rabbitmq/rabbitmq-management/v3.8.9/bin/rabbitmqadmin
RUN chmod +x rabbitmqadmin
## FILE INITIALIZATION
# Get tapisservice.log ready for logging
RUN touch /home/tapis/tapisservice.log
# Get config.json ready for mount
RUN touch /home/tapis/config.json
# We overwrite sqlmodel package because it's buggy, but we still want the features.
COPY SQLMODEL/main.py /usr/local/lib/python3.10/site-packages/sqlmodel/main.py
# Copy files
COPY alembic /home/tapis/alembic
COPY tests /home/tapis/tests
COPY service /home/tapis/service
COPY docs /home/tapis/docs
COPY configschema.json entry.sh alembic.ini /home/tapis/
RUN chmod +x /home/tapis/entry.sh
# Add helpful navigation through filenames at root of container
RUN touch /pods-code-in---home-tapis
# Permission finalization
RUN chown -R tapis:tapis /home/tapis
# Run everything as tapis user (uid 4872)
USER tapis
CMD ["/home/tapis/entry.sh"]