Skip to content

Commit 72786bb

Browse files
committed
copied from atmo
0 parents  commit 72786bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+6500
-0
lines changed

.coveragerc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[run]
2+
source = tecken
3+
branch = True
4+
data_file = /tmp/.coverage
5+
6+
[report]
7+
omit =
8+
tests/*
9+
*migrations*
10+
*management*
11+
*management/commands*
12+
13+
[xml]
14+
output = /tmp/coverage.xml

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.git
2+
.bash_history

.editorconfig

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Top-most EditorConfig file ?
2+
root = true
3+
4+
# Unix-style newlines with a newline ending every file
5+
[*]
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
# Indentiation
11+
[*.py]
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.{css,js,json,html,yml}]
16+
indent_style = space
17+
indent_size = 2

.env-dist

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
PYTHONUNBUFFERED=1
2+
PYTHONDONTWRITEBYTECODE=1
3+
DATABASE_URL=postgres://postgres@db/postgres
4+
REDIS_URL=redis://redis:6379/0
5+
PORT=8000
6+
DJANGO_DEBUG=True
7+
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1,
8+
DJANGO_SITE_URL=http://localhost:8000
9+
AWS_ACCESS_KEY_ID=
10+
AWS_SECRET_ACCESS_KEY=
11+
AWS_DEFAULT_REGION=us-west-2

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.env
2+
*.pyc
3+
.DS_Store
4+
docs/_build
5+
MANIFEST
6+
.coverage
7+
coverage.xml
8+
*.db
9+
dist/
10+
/static/
11+
.cache/
12+
revision.txt
13+
version.json
14+
htmlcov
15+
node_modules/
16+
.npm/
17+
.bash_history
18+
coverage

.pyup.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
search: False
2+
label_prs: update
3+
requirements:
4+
- requirements.txt

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Changelog
2+
3+
Welcome to the running release notes of the Mozilla Symbol Server!
4+
5+
- You can use this document to see high-level changes done in each release
6+
that is git tagged.
7+
8+
- Backward-incompatible changes or other notable events that have an
9+
impact on users are noted individually.
10+
11+
- The order of this changelog is descending (newest first).
12+
13+
- Dependency updates are only mentioned when they require user attention.
14+
15+
## 2017.3.4 (2017-03-20)
16+
17+
...

Dockerfile

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
FROM python:3.5-slim
2+
MAINTAINER Jannis Leidel <[email protected]>
3+
4+
ENV PYTHONUNBUFFERED=1 \
5+
PYTHONPATH=/app/ \
6+
DJANGO_CONFIGURATION=Prod \
7+
PORT=8000
8+
9+
EXPOSE $PORT
10+
11+
# add a non-privileged user for installing and running the application
12+
# don't use --create-home option to prevent populating with skeleton files
13+
RUN mkdir /app && \
14+
chown 10001:10001 /app && \
15+
groupadd --gid 10001 app && \
16+
useradd --no-create-home --uid 10001 --gid 10001 --home-dir /app app
17+
18+
# install a few essentials and clean apt caches afterwards
19+
RUN apt-get update && \
20+
apt-get install -y --no-install-recommends \
21+
apt-transport-https build-essential curl git libpq-dev \
22+
postgresql-client gettext sqlite3 libffi-dev && \
23+
apt-get autoremove -y && \
24+
apt-get clean && \
25+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
26+
27+
# Install node from NodeSource
28+
RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
29+
echo 'deb https://deb.nodesource.com/node_4.x jessie main' > /etc/apt/sources.list.d/nodesource.list && \
30+
echo 'deb-src https://deb.nodesource.com/node_4.x jessie main' >> /etc/apt/sources.list.d/nodesource.list && \
31+
apt-get update && apt-get install -y nodejs
32+
33+
# Create static and npm roots
34+
RUN mkdir -p /opt/npm /opt/static && \
35+
chown -R 10001:10001 /opt
36+
37+
# Install Python dependencies
38+
COPY requirements.txt /tmp/
39+
# Switch to /tmp to install dependencies outside home dir
40+
WORKDIR /tmp
41+
RUN pip install --no-cache-dir -r requirements.txt
42+
43+
# Install frontend dependencies using NPM
44+
COPY package.json /opt/npm/
45+
46+
# Switch to /opt/npm to install dependencies outside home dir
47+
WORKDIR /opt/npm
48+
RUN npm install && \
49+
chown -R 10001:10001 /opt/npm && \
50+
npm cache clean
51+
52+
# Switch back to home directory
53+
WORKDIR /app
54+
55+
COPY . /app
56+
57+
RUN chown -R 10001:10001 /app
58+
59+
USER 10001
60+
61+
RUN DJANGO_CONFIGURATION=Build && \
62+
python manage.py collectstatic --noinput
63+
64+
# Using /bin/bash as the entrypoint works around some volume mount issues on Windows
65+
# where volume-mounted files do not have execute bits set.
66+
# https://github.com/docker/compose/issues/2301#issuecomment-154450785 has additional background.
67+
ENTRYPOINT ["/bin/bash", "/app/bin/run"]
68+
69+
CMD ["web"]

Dockerfile.dev

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
FROM python:3.5-slim
2+
MAINTAINER Jannis Leidel <[email protected]>
3+
4+
ENV PYTHONUNBUFFERED=1 \
5+
PYTHONPATH=/app/ \
6+
DJANGO_CONFIGURATION=Dev \
7+
PORT=8000
8+
9+
EXPOSE $PORT
10+
11+
# add a non-privileged user for installing and running the application
12+
# don't use --create-home option to prevent populating with skeleton files
13+
RUN mkdir /app && \
14+
chown 10001:10001 /app && \
15+
groupadd --gid 10001 app && \
16+
useradd --no-create-home --uid 10001 --gid 10001 --home-dir /app app
17+
18+
# install a few essentials and clean apt caches afterwards
19+
RUN apt-get update && \
20+
apt-get install -y --no-install-recommends \
21+
apt-transport-https build-essential curl git libpq-dev \
22+
postgresql-client gettext sqlite3 libffi-dev && \
23+
apt-get autoremove -y && \
24+
apt-get clean && \
25+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
26+
27+
# Install node from NodeSource
28+
RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
29+
echo 'deb https://deb.nodesource.com/node_4.x jessie main' > /etc/apt/sources.list.d/nodesource.list && \
30+
echo 'deb-src https://deb.nodesource.com/node_4.x jessie main' >> /etc/apt/sources.list.d/nodesource.list && \
31+
apt-get update && apt-get install -y nodejs
32+
33+
# Create static and npm roots
34+
RUN mkdir -p /opt/npm /opt/static && \
35+
chown -R 10001:10001 /opt
36+
37+
# Install Python dependencies
38+
COPY requirements.txt /tmp/
39+
# Switch to /tmp to install dependencies outside home dir
40+
WORKDIR /tmp
41+
RUN pip install --no-cache-dir -r requirements.txt
42+
43+
# Install frontend dependencies using NPM
44+
COPY package.json /opt/npm/
45+
46+
# Switch to /opt/npm to install dependencies outside home dir
47+
WORKDIR /opt/npm
48+
RUN npm install && \
49+
chown -R 10001:10001 /opt/npm && \
50+
npm cache clean
51+
52+
# Switch back to home directory
53+
WORKDIR /app
54+
55+
USER 10001
56+
57+
# Using /bin/bash as the entrypoint works around some volume mount issues on Windows
58+
# where volume-mounted files do not have execute bits set.
59+
# https://github.com/docker/compose/issues/2301#issuecomment-154450785 has additional background.
60+
ENTRYPOINT ["/bin/bash", "/app/bin/run"]
61+
62+
CMD ["web-dev"]

0 commit comments

Comments
 (0)