-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathDockerfile
More file actions
66 lines (57 loc) · 1.94 KB
/
Dockerfile
File metadata and controls
66 lines (57 loc) · 1.94 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
FROM weblate/weblate:5.15.0.2@sha256:33face3c4ed1f8bf220f12b0de0eac0097714eb9f2396432ac36bbc52b86a9a0
##########
# WARNING!
# This dockerfile is meant to be used in the development process
# and WILL perform very poorly in production.
#
# For production-ready dockerfile see:
# https://github.com/WeblateOrg/docker
#########
#WORKDIR /srv
ARG USER_ID=1000
ARG GROUP_ID=1000
USER root
ENV PATH=/app/venv/bin:/opt/python/bin:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin
ENV UV_CACHE_DIR=/app/data/uv-cache
ENV UV_LINK_MODE=copy
# Make sure user exists in the container
RUN if ! getent group "${GROUP_ID}"; then \
groupadd --gid "${GROUP_ID}" developer; \
fi \
&& if ! getent passwd "${USER_ID}"; then \
useradd --gid "${GROUP_ID}" --uid "${USER_ID}" --groups root,tty,weblate --shell /bin/bash developer; \
fi
# Following should match what dev container in docker-base repo includes
RUN apt-get update && apt-get install -y \
pkg-config \
make \
gcc \
g++ \
libicu-dev \
libcairo2-dev \
libxml2-dev \
libacl1-dev \
liblz4-dev \
libzstd-dev \
libxxhash-dev \
libmariadb-dev \
libxmlsec1-dev \
libsasl2-dev \
libldap2-dev \
libssl-dev \
libffi-dev \
libpq-dev \
zlib1g-dev \
libjpeg62-dev \
libgirepository-2.0-dev
# List should match weblate/weblate
RUN chown -R "${USER_ID}:${GROUP_ID}" /etc/nginx/sites-available/ /var/log/nginx/ /var/lib/nginx /app/data /app/cache /run /home/weblate /etc/localtime /etc/supervisor/conf.d /tmp /home
# Start with fresh venv
# Using the original would work, but chown on it is super slow, see https://github.com/docker/for-linux/issues/388
RUN rm -rf /app/venv && mkdir /app/venv && chown "${USER_ID}:${GROUP_ID}" /app/venv
COPY --link --chmod=0755 start-dev /app/bin/
ENTRYPOINT ["/app/bin/start-dev"]
CMD ["runserver"]