You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install nodejs dependencies and cache them by adding the following lines before the `COPY` command:
112
+
113
+
```
114
+
# Cache node deps
115
+
COPY package.json ./
116
+
RUN npm install
117
+
```
118
+
119
+
Build and digest static assets by adding the following lines after the `COPY` command:
120
+
121
+
```
122
+
RUN ./node_modules/brunch/bin/brunch b -p && \
123
+
mix phoenix.digest
124
+
```
125
+
126
+
Add the following directories to `.dockerignore`:
127
+
128
+
```
129
+
node_modules
130
+
priv/static
131
+
```
132
+
133
+
Remove `config/prod.secret.exs` file and remove a reference to it from `config/prod.exs`. Configure your app's secrets directly in `config/prod.exs` using the environment variables.
134
+
135
+
Make sure to add `server: true` to your app's Endpoint config.
136
+
137
+
Build the images and run the release image normally.
138
+
139
+
Check out [this post](https://shovik.com/blog/8-deploying-phoenix-apps-with-docker) for detailed walkthrough of the Phoenix app configuration.
0 commit comments