Repositório do projeto: https://github.com/fdaciuk/conduit-api
Especificação da API: https://gothinkster.github.io/realworld/docs/specs/backend-specs/introduction
server { | |
listen 80; | |
index index.php index.html; | |
server_name _; | |
root /var/www/html/public; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} |
version: "3" | |
networks: | |
laravel: | |
services: | |
nginx: | |
build: | |
context: ./dockerfiles | |
dockerfile: nginx.dockerfile | |
args: |
FROM nginx:stable-alpine | |
ARG UID | |
ARG GID | |
ENV UID=${UID} | |
ENV GID=${GID} | |
RUN delgroup dialout |
Repositório do projeto: https://github.com/fdaciuk/conduit-api
Especificação da API: https://gothinkster.github.io/realworld/docs/specs/backend-specs/introduction
# Setup Stage - set up the ZSH environment for optimal developer experience | |
FROM alpine:latest AS setup | |
# Let scripts know we're running in Docker (useful for containerised development) | |
ENV RUNNING_IN_DOCKER true | |
# Use the unprivileged `main` user (created without a password ith `-D`) for safety | |
RUN adduser -D main | |
RUN mkdir -p /app \ | |
&& chown -R main:main /app | |
# Set up ZSH and our preferred terminal environment for containers | |
RUN apk --no-cache add zsh curl git |
MySql Client:
The mysql-client
package allows you to connect to a MySQL server. It will give you the mysql
command-line program.
MySql Server:
The mysql-server
package allows to run a MySQL server which can host multiple databases and process queries on those databases.
That’s one of the real strengths of Docker: the ability to go back to a previous commit. The secret is simply to docker tag the image you want. | |
Here’s an example. In this example, I first installed ping, then committed, then installed curl, and committed that. Then I rolled back the image to contain only ping: | |
$ docker history imagename | |
IMAGE CREATED CREATED BY SIZE | |
f770fc671f11 12 seconds ago apt-get install -y curl 21.3 MB | |
28445c70c2b3 39 seconds ago apt-get install ping 11.57 MB | |
8dbd9e392a96 7 months ago 131.5 MB |
/* | |
Needs Hibernate 5.2.11.Final | |
*/ | |
public List<ObjectNode> getQuery( | |
Integer anno, | |
Integer settimana) { | |
Query q = em.createNativeQuery( | |
"NATIVE SQL....",Tuple.class); |
/** | |
* Filters an array of objects using custom predicates. | |
* | |
* @param {Array} array: the array to filter | |
* @param {Object} filters: an object with the filter criteria | |
* @return {Array} | |
*/ | |
function filterArray(array, filters) { | |
const filterKeys = Object.keys(filters); | |
return array.filter(item => { |
/** | |
* Multi-filter an array of objects | |
* @param {Array} array : list of elements to apply a multiple criteria filter | |
* @param {Object} filters: Contains multiple criteria filters by the property names of the objects to filter | |
* @return {Array} | |
*/ | |
function multiFilter(array, filters) { | |
let filterKeys = Object.keys(filters); | |
// filters all elements passing the criteria | |
return array.filter((item) => filterKeys.every((key) => (filters[key].indexOf(item[key]) !== -1))); |