-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
42 lines (30 loc) · 1.05 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
FROM python:3.9-slim
ARG USER_ID=2000
ARG GROUP_ID="${USER_ID}"
ARG USERNAME=basecampy
ARG WORKDIR=/bc3
ARG HOME_DIR="/home/${USERNAME}"
ARG DEFAULT_TIMEZONE="America/Chicago"
ENV WORKDIR="${WORKDIR}"
ENV HOME_DIR="${HOME_DIR}"
ENV BC3_OAUTH_BIND_ADDRESS=0.0.0.0
ENV BC3_CONTAINER=1
ENV BC3_CONFIG_PATH="/etc/basecamp.conf"
ENV PYTHONPATH="${WORKDIR}"
# Change to your timezone by specifying with docker run
ENV TZ="${DEFAULT_TIMEZONE}"
COPY requirements.txt .
RUN pip install -r requirements.txt
WORKDIR "${WORKDIR}"
COPY . .
RUN addgroup --gid ${GROUP_ID} "${USERNAME}" \
&& adduser --home "${HOME_DIR}" --gecos '' --uid "${USER_ID}" --gid "${GROUP_ID}" --disabled-password "${USERNAME}" \
&& ln -s "${WORKDIR}/bc3" "/usr/local/bin/bc3" \
&& touch "${BC3_CONFIG_PATH}" \
&& chown -R "${USERNAME}:${USERNAME}" "${WORKDIR}" "${BC3_CONFIG_PATH}"
RUN python setup.py install
USER ${USERNAME}
# for the bc3 configure command, it must listen on your localhost for
# the redirect URL to receive an authorization token
EXPOSE 33333
CMD ["bc3", "--help"]