Commit 465918d 1 parent 24a5a0a commit 465918d Copy full SHA for 465918d
File tree 3 files changed +20
-29
lines changed
3 files changed +20
-29
lines changed Original file line number Diff line number Diff line change 39
39
with :
40
40
bundler-cache : true
41
41
42
- - name : Find yarn cache location
43
- id : yarn-cache
44
- run : echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
45
-
46
- - name : JS package cache
47
- uses : actions/cache@v4
48
- with :
49
- path : ${{ steps.yarn-cache.outputs.dir }}
50
- key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
51
- restore-keys : |
52
- ${{ runner.os }}-yarn-
53
-
54
42
- name : Install packages
55
43
run : |
56
44
yarn install --frozen-lockfile
Original file line number Diff line number Diff line change 1
1
# Build builder image
2
- FROM ruby:3.3.4-alpine as builder
2
+ FROM ruby:3.3.4-alpine as base
3
3
4
4
WORKDIR /app
5
5
6
+ # tzdata: required to set timezone
7
+ RUN apk --no-cache add \
8
+ tzdata \
9
+ postgresql-client
10
+
11
+ # Ensure latest rubygems is installed
12
+ RUN gem update --system
13
+
6
14
# Install dependencies
7
15
RUN apk --no-cache add \
8
16
ruby-dev \
9
17
build-base \
10
18
postgresql-dev \
11
- tzdata \
12
19
yarn
13
20
14
21
# Copy required files
@@ -35,16 +42,7 @@ RUN rm -rf node_modules log/* tmp/* /tmp && \
35
42
rm -rf /usr/local/bundle/cache
36
43
37
44
# Build runtime image
38
- FROM ruby:3.3.4-alpine
39
-
40
- # The application runs from /app
41
- WORKDIR /app
42
-
43
- # libpq: required to run postgres, tzdata: required to set timezone
44
- RUN apk --no-cache add \
45
- libpq \
46
- tzdata \
47
- postgresql-client
45
+ FROM base
48
46
49
47
# Add non-root user and group with alpine first available uid, 1000
50
48
RUN addgroup -g 1000 -S appgroup && \
@@ -56,16 +54,14 @@ COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
56
54
57
55
# Create log and tmp
58
56
RUN mkdir -p log tmp
59
- RUN chown -R appuser:appgroup db log tmp
57
+ RUN chown -R appuser:appgroup ./*
60
58
61
59
# Set user
62
60
USER 1000
63
61
64
62
ARG APP_BUILD_DATE
65
- ENV APP_BUILD_DATE ${APP_BUILD_DATE}
66
-
67
63
ARG APP_BUILD_TAG
68
- ENV APP_BUILD_TAG ${APP_BUILD_TAG}
69
-
70
64
ARG APP_GIT_COMMIT
65
+ ENV APP_BUILD_DATE ${APP_BUILD_DATE}
66
+ ENV APP_BUILD_TAG ${APP_BUILD_TAG}
71
67
ENV APP_GIT_COMMIT ${APP_GIT_COMMIT}
Original file line number Diff line number Diff line change @@ -79,6 +79,13 @@ Use the dev command to run the application. This will use Foreman to start the r
79
79
$ bin/dev
80
80
```
81
81
82
+ #### Running tests
83
+
84
+ ```
85
+ $ bundle exec rspec
86
+ ```
87
+
88
+
82
89
## Admin
83
90
The admin area is accessed via the path '/admin'.
84
91
In production this is restricted to a set of allowed IP addresses which are stored in a secret in a semicolon delimited list.
You can’t perform that action at this time.
0 commit comments